lianne
lianne

Reputation: 13

Redirection works BUT

I have set up a redirect from old domain to new domain and it works however there are links which is not redirecting properly....

 <IfModule mod_rewrite.c>
     RewriteEngine On
     RewriteCond %{HTTP_HOST} ^old.us$ [OR]
     RewriteCond %{HTTP_HOST} ^www.old.us$
     RewriteRule (.*)$ http://www.new.com/$1 [R=301,L]
 </IfModule>

I am trying to redirect : www.old.us/scripts/affiliate.pl?id=505 to www.new.com

but redirects like this : www.new.com/scripts/affiliate.pl?id=505 results a 404 page.

Upvotes: 1

Views: 19

Answers (1)

anubhava
anubhava

Reputation: 785108

Change your code to this:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?old\.us$ [NC]
RewriteRule ^ http://www.new.com/? [R=301,L]

Upvotes: 1

Related Questions