George McKinney Adventures in Software Development

May 18, 2021

WordPress Canonical URL, Permalink Redirect, ERR_TOO_MANY_REDIRECTS

Filed under: Apache,WordPress — georgemck @ 3:22 pm

WordPress uses .htaccess to automatically attempt to correct URLs that are misunderstood. This behavior can lead to errors such as ERR_TOO_MANY_REDIRECTS and prevent intended funcationality such as using an index.html as a landing page for the domain. It is possible to Disable WordPress Canonical URL or Permalink Auto Redirect to fix these problems.

 

This code snippet can be placed at the top of the theme’s functions.php file:

remove_filter('template_redirect', 'redirect_canonical'); 

Powered by WordPress