I’m trying to redirect an entire domain over to another domain while also redirecting a couple of specific pages to specific locations. I also want to preserve www and https on the original domain to ensure there are no errors on the old domain and any links will still work/redirect correctly.
Here’s what I’ve got so far — the https, www, and sitewide redirect work fine, but the page to page redirect(s) don’t do anything:
RewriteEngine on
# Force HTTPS and WWW
RewriteCond %{HTTP_HOST} !^www.(.*)$ (OR,NC)
RewriteCond %{https} off
RewriteRule ^(.*)$ https://www.OLDSITE.com/$1 (R=301)
RewriteRule ^/?OLDPOST1/?(.*)$ https://NEWSITE.com/NEWPOST1/ (L,QSA,R=302)
RewriteRule ^/?OLDPOST2/?(.*)$ https://NEWSITE.com/NEWPOST2/ (L,QSA,R=302)
RewriteRule ^/?OLDPOST3/?(.*)$ https://NEWSITE.com/NEWPOST3/ (L,QSA,R=302)
RewriteRule ^(.*) https://NEWSITE.com (L,QSA,R=302)
Any idea what I’m doing wrong? Thanks in advance!