【问题标题】:Redirect an URL including deep links重定向包含深层链接的 URL
【发布时间】:2015-01-29 07:53:58
【问题描述】:

我有一个域,我想重定向到另一个域,包括其深层链接。

例如: Domain-1.com/example 应该重定向到 Domain-2.com/example。

如何设置,是否可以在 cPanel 中设置?

PS - 我没有编程经验,所以请告诉我如何实现它。

提前致谢!

【问题讨论】:

    标签: .htaccess redirect dns cpanel


    【解决方案1】:

    您可以在 DOCUMENT_ROOT/.htaccess 文件中使用此代码:

    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{HTTP_HOST} ^(www\.)?Domain-1\.com$ [NC]
    RewriteRule ^ http://Domain-2.com%{REQUEST_URI} [R=301,L,NE]
    

    参考资料:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-11
      • 1970-01-01
      • 2012-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多