0

All the examples I've found have something along the lines of

RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule (.*)$ https://www.newdomain.com/$1 [R=301,L]

But it doesn't seem to catch in my .htaccess despite online syntax checkers telling me everything is fine and it'll fire.

I have a bunch of non conflicting individual page RewriteRules that don't conflict with this and fire off fine so I know mod rewrite is working and i'm stumped.

olddomain is a domain that used to reside on a different server but its dns is being pointed at newdomain so all these rules are firing off on the same site if that matters

MrWhite
  • 43,179
  • 8
  • 60
  • 84
Talios
  • 1
  • 1
  • 1
    The rule you posted should work unless you have conflicting rules (which you say there are none). Please include your complete `.htaccess` file with these directives in place. So, what is currently happening when requesting `olddomain.com`? – MrWhite May 25 '22 at 21:45
  • Does this answer your question? [Redirect https://www to https://non-www](https://stackoverflow.com/questions/39868410/redirect-https-www-to-https-non-www) It applies to making any domain the canonical one, not just changing the `www.` prefix. – Walf Jun 08 '22 at 06:06

0 Answers0