Wordpress nginx redirect loop
Not the prettiest fix, but removing the redirect filter in your theme functions.php
file worked for me.
remove_filter('template_redirect', 'redirect_canonical');
From the link provided in OP's answer:
Wordpress did infinite 301 redirect loop
Finally, found a solution:
http://www.violato.net/blog/php/88-wordpress-did-infinite-301-redirect-loop
Hope this will help others that have the same problem as I did.
Thanks everyone.
I had a similar problem using Nginx as a reverse proxy for Apache.
After a few hours I found out it was caused by the $_SERVER["REQUEST_URI"]
being set to index.php
by Nginx instead of the actual url and Wordpress was trying to remove index.php
by redirecting to the url without index.php
in wp-includes/canonical.php
.
The solution for me is using something like this,
proxy_pass http://111.111.111.111:8080$request_uri;
So adding the $request_uri
fixed it.