1

我有一个 ExpressionEngine 安装,它正在运行 2 个网站。

由于我添加了一个指向第二个站点的域,因此我需要更新旧链接: http: //mysite.com/othersite以重定向到http://othersite.com

因此,即使http://othersite.com启动了另一个站点,当我尝试添加时:

RewriteEngine On
RewriteBase /

Redirect 301 /othersite http://othersite.com

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

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

4

1 回答 1

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]

您将获得一个重定向循环,因为您的规则对两个域都有效。

于 2013-08-06T16:57:03.503 回答