0

我正在尝试重定向页面,例如:

c.domain1.se/folder1/main.html

www.domain2.se/folder1/main.html

我的 htaccess 看起来像这样:

RewriteCond %{HTTP_HOST} c\.domain1\.se$ [NC] 
RewriteRule ^ domain2.se%{REQUEST_URI} [QSA,R=301,L,NE]

我收到以下消息:

Forbidden
You don't have permission to access /set on this server.

Webhost 声称没有其他 htaccess 文件干扰 c.domain1.se 上的文件。

关于可能是什么问题的任何想法?

4

2 回答 2

0

您应该在规则的目标中包含该方案并为条件匹配添加边界(通过^):

RewriteCond %{HTTP_HOST} ^c\.domain1\.se$ [NC] 
RewriteRule ^ http://domain2.se%{REQUEST_URI} [QSA,R=301,L,NE]
于 2013-10-08T20:38:08.747 回答
0

试试这个代码:

RewriteCond %{HTTP_HOST} ^c\.domain1\.se$ [NC] 
RewriteRule ^ http://domain2.se%{REQUEST_URI} [R=301,L,NE]
于 2013-10-08T20:38:25.973 回答