【问题标题】:"There was an error adding the redirect. Redirecting will cause a redirection loop"“添加重定向时出错。重定向将导致重定向循环”
【发布时间】:2019-08-04 21:44:36
【问题描述】:

创建附加域后,我在 cpanel 中的“添加重定向”部分收到此错误:

There was an error adding the redirect. Redirecting "https://example.com" 
will cause a redirection loop because "http://.*/", which is located at 
"/home/folder/", is above "https://example.com", which is located at 
"/home/folder/"
  • 类型 = 永久 (301) 重定向
  • 所有公共领域
  • 重定向到:“https://addonDomain
  • 通配符重定向

最好通过 cpanel,目标是仅通过 301 重定向重定向,用于 SEO 目的,并将主域重定向到附加域。如何修复这个循环?谢谢!

【问题讨论】:

    标签: redirect cpanel


    【解决方案1】:

    您可以通过 .htaccess 使用

    使用此代码编辑:

    #Force www:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
    RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301,NC]
    

    将 yourdomain.com 更改为您的域名。这对我有用。

    【讨论】:

      猜你喜欢
      • 2015-11-09
      • 2016-06-15
      • 1970-01-01
      • 1970-01-01
      • 2014-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多