开发者

Redirect URL to new URL

开发者 https://www.devze.com 2023-02-26 05:32 出处:网络
How do I redirect all traffic from test/(.*) to http://newdomain.com/test/$1? I tried this, but that didn\'t work: RewriteRule ^test/(.*) http://domain.com/test/$1 [R开发者_StackOverflow中文版=301,L]I

How do I redirect all traffic from test/(.*) to http://newdomain.com/test/$1? I tried this, but that didn't work: RewriteRule ^test/(.*) http://domain.com/test/$1 [R开发者_StackOverflow中文版=301,L]


I think, you need to add a slash to the beginning of the rule:

RewriteRule ^/test/(.*) http://domain.com/test/$1 [R=301,L]


Add the line RewriteEngine On before your rewrite rule.

0

精彩评论

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