在创建了一个附加域之后,我在Add重定向部分的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/"最好是通过cpanel,目标是仅通过301重定向,为了SEO目的,并将主域重定向到附加域。如何修复这个循环?谢谢!
发布于 2020-05-11 15:31:25
您可以通过.htaccess使用
使用此代码编辑:
#Force www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301,NC]用您的域名更改yourdomain.com。这对我来说很管用。
https://stackoverflow.com/questions/57350412
复制相似问题