我最初买了一个托pipe软件包的域名http://example.com ,并运行了一段时间的博客。
现在我已经买了一个域名http://example.com.au添加并重复的内容,但现在想写一个301redirect。
由于新域名是原始服务器的插件,它共享.htaccess文件,我实现的一般301redirect导致无限redirect循环。
什么是正确的方法来做到这一点?
我试图按照这里发布的早期post上的指示。
基本上插入这个:
Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^www.example.com [NC] RewriteRule (.*) http://www.example.com.au/$1 [R=301,L]
这是问题:
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
这个正则expression式没有终止,所以它匹配www.example.com和www.example.com.au 。
要解决这个问题,请终止正则expression式。
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]