2013-08-02 68 views
1

我有一个ExpressionEngine安装,即运行2个网站。多站点ExpressionEngine .htaccess问题

自从我加入一个域指向第二个站点,我需要更新旧链接:http://mysite.com/othersite重定向到http://othersite.com

因此,即使http://othersite.com将在其他网站,当我试图添加:

RewriteEngine On 
RewriteBase/

Redirect 301 /othersite http://othersite.com 

到mysite.com根.htaccess文件,它最终导致重定向循环的othersite.com

我怎样才能解决这个问题?

+0

不完全清楚你的所有不同的重定向。你说mysite应该重定向到othersite,但是你会说“尽管http://othersite.com带来了其他网站(...)”。 othersite是否也重定向到mysite?在浏览器中输入哪个网址会导致重定向循环? – Kay

+0

第mysite.com去mysite.com。 othersite.com转到othersite.com,但是... mysite.com/othersite是othersite驻留的地方,所以我需要将任何链接重定向到mysite.com/othersite to othersite.com。但是,当我这样做时(如我在上面发布的代码中),它会导致重定向循环 – Kevin

+0

好吧,只是为了解决这个问题:你真的想重定向输入'http:// mysite.com/othersite'的人吗?到他们浏览器的地址栏中输入“http:// othersite.com”,然后从“http:// mysite.com/othersite”提供文件?或者,用户只需要知道/输入“othersite”(然后“秘密地”从mysite/othersite提供)? (如果你将人从A重定向到B,然后返回到A,当然会有循环!) – Kay

回答

1
.htaccess

RewriteEngine on 
RewriteBase/

RewriteCond %{HTTP_HOST} ^(www\.)mysite.com$ [NC] 
RewriteCond %{REQUEST_URI} ^/othersite [NC] 
RewriteRule ^othersite/(.*)$ http://othersite.com/$1 [R=301,L] 

你得到一个重定向循环,因为你的规则是两个域活跃

改变你的根。