开发者

301 redirect with htaccess & textpattern

Trying to set up a 301 redirect for a change in domain. I'm using Textpattern which already has a mod rewrite. When adding the redirect I'm prompted with a error page on the site, stating that the page has resulted in too many redirects!

This is the htaccess file in use...

<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /relative/web/path/

RewriteRule (.*) http://ww开发者_如何转开发w.domain.com/$1 [R=301,L] #(this has been added to the default textpattern htaccess file)

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]

RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*) index.php

RewriteCond %{HTTP:Authorization}  !^$
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>

Many thanks for any advise you can give.


From what domain you try to redirect? May be you have set cycling - trying to redirect from site.com to site.com?


Add this after RewriteEngine On

RewriteCond %{HTTP_HOST} ^(?!www.yournewdomain.com$).*$
RewriteRule (.*) http://www.yournewdomain.com/$1 [R=301,L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜