: How to htaccess redirect 301 from old to new site with conditions Is it possible at the same time to redirect 301 multiple URLs/pages from old to new redirect 301 all remain old pages to
Is it possible at the same time to
redirect 301 multiple URLs/pages from old to new
redirect 301 all remain old pages to new homepage
redirect 301 both www/without of old homepage to new homepage
exclude one URL
URLs don't match (meaning each old site URL is redirected to a different URL at the new site.
More posts by @Shanna517
1 Comments
Sorted by latest first Latest Oldest Best
Maybe try something like this:
RewriteCond %{HTTP_HOST} !^oldsite.com$
RewriteRule ^/?unchanged/url - [L,QSA]
RewriteCond %{HTTP_HOST} !^(www.)?newsite.com$
RewriteRule ^(/?specific/page) newsite.com/ [R=301,L]
RewriteCond %{HTTP_HOST} !^(www.)?newsite.com$
RewriteRule ^ newsite.com/ [R=301,L]
The order is the important part. First, handle the URL which you don't want to apply the rules to. The [L] flag should stop processing further rules. Then, handle your other specific URLs. After that, redirect the other URLs.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.