#63163 closed defect (bug) (worksforme)
WordPress always redirecting secondary domains to main domain set in General settings
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.7.2 |
Component: | Rewrite Rules | Keywords: | |
Focuses: | Cc: |
Description
My WordPress installs have, for some reason, started redirecting secondary domains to the main domain set in General settings. Before, this was only happening when trying to login on the secondary domains. You can view this behaviour at test.itwithme.ca, which redirects to test.itwithme.com. I know WordPress is causing this redirect because when I change the domain set as primary domain in General settings, the redirect also changes to redirect to this domain (so .com would start redirecting to .ca instead of the other way around). Also, my .htaccess files don't contain such a redirect, nor do my Apache sites-available config files. The only plugins I have installed are: all in one wp migration, litespeed cache, wordfence security, wp control. I also have Astra installed as the only theme.
I think a redirect like this should never happen, not even when users are logging in. Because I want to serve different content based on the URL users are accessing the site from. This doesn't work (is impossible to do) with a redirect like this. Also it would be nice if users stayed on the same domain when logging in, so that their content doesn't change when logging in.
I hope you can reproduce my error and fix it. Let me know if you need any more information!
Attachments (3)
Change History (6)
#2
@
3 months ago
@josvlaar Hello and welcome back to trac.
Are you able to test this with a standard WordPress install without any plugins installed and running a default theme, such as Twenty Twenty-Five, and see if you continue to have the issue?
Also, are you running WordPress in single site mode or in a multi-site configuration?
Thanks
#3
@
3 months ago
- Resolution set to worksforme
- Status changed from new to closed
Dear Peter,
I think this behavior from WordPress is a good thing after all (and not a bug). I have been reading about SEO. Apparently (for the sake of backlinks) it's better to use a single domain than multiple ones. Because with multiple domains, backlinks get spread over all of them and so all domains will have a lower score than when using a single domain. Having a lot of backlinks apparently outweighs the advantage of using localized TLD's. So I will be using only my .com domain and hope that all others will continue to be redirected to the .com domain by WordPress. For what it's worth, my site is not a multisite.
Thank you all for your time!
Jos
I checked the Inspect settings and observing the /redirect call is indeed triggered for
test.itwithme.ca to test.itwithme.com
Attaching more screenshots for debugging.