www.data-blogger.com
www.data-blogger.com

Reputation: 4164

Redirect URL to new URL

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=301,L]

Upvotes: 0

Views: 139

Answers (2)

nfechner
nfechner

Reputation: 17525

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

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

Upvotes: 1

Nick Moore
Nick Moore

Reputation: 15857

Add the line RewriteEngine On before your rewrite rule.

Upvotes: 1

Related Questions