Redirect the entire/whole domain with exceptions
-
Hi Guys,
I want to redirect an entire domain to a new one using the .htaccess file. However, i would like to implement some exceptions as some pages of the old domain have a new version in the new domain. To do this I have done:
RewriteEngine on
RewriteRule ^/about-us https://www.newdomain/about-us [R=301,L]
RewriteRule ^(.*) https://www.newdomain.com/ [R=301,L]I have also tried:
Redirect 301 /about-us https://www.newdomain/about-us
RewriteEngine on
RewriteRule ^(.*) https://www.newdomain.com/ [R=301,L]But none of them work and the old domain redirects entirely to the new one ignoring the exceptions (in this case the about-us page).
I have also tried:
RewriteEngine on
RewriteRule ^/about-us https://www.newdomain/about-us [R=301,L]RewriteEngine on
RewriteRule ^(.*) https://www.newdomain.com/ [R=301,L]Can you please help me with this?
Thanks!
- The topic ‘Redirect the entire/whole domain with exceptions’ is closed to new replies.