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.
精彩评论