Sometimes we need to force redirection from OLD domains to NEW..
#Q4LAUNCH 301 REDIRECT OLD DOMAIN TO NEW DOMAIN
RewriteEngine on
RewriteCond %{HTTP_HOST} ^OLDDOMAIN\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.OLDDOMAIN\.com [NC]
RewriteRule ^(.*)$ https://NEWDOMAIN\.com/$1 [L,R=301,NC]
#END Q4LAUNCH 301 REDIRECT OLD DOMAIN TO NEW DOMAIN
#Q4LAUNCH 301 REDIRECT OLD DEMO DOMAIN TO NEW PROD DOMAIN
RewriteEngine on
RewriteCond %{HTTP_HOST} ^OLDDOMAIN\.q4\-demo\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.OLDDOMAIN\.q4\-demo\.com [NC]
RewriteRule ^(.*)$ https://NEWDOMAIN\.com/$1 [L,R=301,NC]
#END Q4LAUNCH 301 REDIRECT OLD DOMAIN TO NEW DOMAIN
Or simply force the removal of www if needed on the same domain..
#Q4LAUNCH 301 REDIRECT OLD DOMAIN TO NEW DOMAIN
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.THEDOMAIN.com [NC]
RewriteRule ^(.*)$ https://THEDOMAIN.com/$1 [L,R=301,NC]
#END Q4LAUNCH 301 REDIRECT OLD DOMAIN TO NEW DOMAIN