Reputation: 13
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
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