Search code examples
wordpresshttp-redirectwordpress-hook

Prevent WordPress home page redirect after WP 4.4.1


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.


Solution

  • 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.