Fix for wordpress breaking mod_rewrite/friendly URLs

If you’ve just upgraded WordPress and find that when you browse your blog your web browser displays the following message

“the server is redirecting the request for this address in a way that will never complete.”

To fix this all you need to do is edit one file in the WordPress installation.

The problem is due to the canonical redirection functionality, it redirects incorrect permalinks to their correct ones.

To disable that functionality edit /wp-includes/canonical.php and comment out the last line:
[code]add_action(‘template_redirect’, ‘redirect_canonical’);[/code]
change to:
[code]//add_action(‘template_redirect’, ‘redirect_canonical’);[/code]

Here’s the post on the WordPress support forum that details the problem and solution

This post was at first intended as a note to myself, so that in the future when i update WordPress and find my blog does an infinite loop then I can quickly change it.
I then decided to keep the post open, so that others with the same problem can quickly search and fix it!