0

如何将所有流量从 test/(.*) 重定向到http://newdomain.com/test/ $1?我试过这个,但没有奏效:RewriteRule ^test/(.*) http://domain.com/test/$1 [R=301,L]

4

2 回答 2

1

RewriteEngine On在重写规则之前添加该行。

于 2011-04-16T09:03:55.033 回答
1

我认为,您需要在规则的开头添加一个斜杠:

RewriteRule ^/test/(.*) http://domain.com/test/$1 [R=301,L]
于 2011-04-16T09:06:08.637 回答