The WP is redirecting the home page to the home_url (or site_url not sure since both are the same values) even when arrived to the page using the parked domains. This started after the recent update. Also, I confirmed, no htaccess, server configs nor any plugins doing the redirect.
After thorough research the solution I found are placing the following in the functions.php remove_action('template_redirect', 'redirect_canonical');
. That solution is years old and don’t seem to work anymore.
The way I set it up is I park the domains to the WP site, and the contents displayed are based on the domain. Just happens on the index page, if it has any urls appended, it works. Any help is appreciated.
It looks like the new version of the WP enforced the redirect on homepage. My issue was resolved with the
remove_filter('template_redirect','redirect_canonical');
. I wasn’t able to see the change in effect after I applied that fix because the browser cached it somehow. I tested it on the Private mode, and it worked. I had to clear the cache to see it working.I ran into the same issue and got i fixed, thanks to your answer. However, what are the implications of removing that filter? It sound important by name, so did you experience some new issues so far?
PS: i would have posted a comment to the previous answer, but my stackoverflow points are below 50…
LTDInvestments is actually correct. In your wp-config.php, ensure that ‘WP_HOME’ and ‘WP_SITEURL’ have values which are lowercased.
This fixed it for me; I guess case-sensitivity is something you should mind throughout your wp-config.php and wp-admin settings.
This works for me (as for version 5.9.3):
Note: this removes redirecting for urls that partly match slug of content that exists for example domain.com/terms will no longer redirect to domain.com/terms-and-conditions but instead return a 404 page.
Also changing the WordPress Address (URL) and Site Address (URL) to all lower case works.