Fix WordPress nginx infinite redirect

Veröffentlicht von philipp am

I’ve tried to access my newly setup WordPress-page through Chrome, Safari and Firefox and yll gave me the same endless redirect error. Finally after long search on Google and trial and error I found the solution

Go to: /var/www/wordpress/wp-content/themes/THEMENAME/functions.php and add remove_filter('template_redirect', 'redirect_canonical'); right after the php opening tag (<?php). If you don’t know which theme is being used (like in my case, because WordPress didn’t want to load from the beginning), just add this line to all available themes in the wp-content/themes-folder.

After this change the WordPress page magically loaded. So instead of the 5 minute WordPress setup it was an about 3 hour setup, just because of this error.

0 Kommentare

Schreibe einen Kommentar


Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert