Inconsistent redirection confusion
-
I am badly confused about redirection for three of my websites, and I’m not even sure that WordPress is the right place to post my question. If there is a better place, please let me know!
Background
I have three WordPress websites. Two of them start with www and one doesn’t. Let’s call them:
https://example-a.com
https://www.example-b.com
https://www.example-c.com
The three websites are pretty much similar in structure, and I haven’t done any non-standard customisations — just installing themes and plugins, and customising via the WordPress back-end.
Apache redirects
- HTTPS is enforced via each site’s
.htaccess
file. - WordPress Settings > General > WordPress URL and Site Address URL are all correctly set to the URLs given above (including
https://
, andwww.
for the second two sites). - The first site’s
.htaccess
file removeswww.
if the user has entered it. - The second two sites’
.htacces
files addwww.
if they aren’t subdomains (so it addswww.
toexample-b.com
but not to/test.example-b.com
). - The
.htaccess
files for the second two sites are identical. I have checked this by runningdiff
against them.
Expected and unexpected redirects
When I enter a subdomain — let’s say
mail.example-b.com
— I get inconsistent results. Specifically, the first and third work correctly, but the second doesn’t, as follows.- <
mail.example-a.com
I expect this to not redirect, and it correctly doesn’t redirect. mail.example-b.com
I expect this to not redirect, but it redirects tohttps://www.example-b.com
. I don’t know what is causing the redirect.mail.example-c.com
I expect this to not redirect, and it correctly doesn’t redirect.
So, the second two are inconsistent.
So…
What could be causing
mail.example-b.com
to redirect, butmail.example-c.com
to not redirect? I have no idea where else to look!Thanks for reading!
- HTTPS is enforced via each site’s
- The topic ‘Inconsistent redirection confusion’ is closed to new replies.