WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] nginx 301 redirect loop (4 posts)

  1. Keith
    Member
    Posted 2 years ago #

    I have recently switched one of our high-traffic sites from Apache to nginx.

    On a few of the posts I get this 301 redirect loop. For example, this page gives the loop:

    http://www.storyofstuff.org/2012/01/29/compost/

    But if you add a ? at the end the post loads fine:

    http://www.storyofstuff.org/2012/01/29/compost/?

    Other posts on the blog load fine, for example:

    http://www.storyofstuff.org/2012/01/29/concentrated-packaging/

    I followed the configuration to the letter here and have tried using the WP-nginx plugin. The only difference is I included the SSL directives.

    Looking at the headers send using curl I get the following:

    user@host ~ $ curl -i http://www.storyofstuff.org/2012/01/29/compost/
    HTTP/1.1 301 Moved Permanently
    Server: nginx
    Date: Mon, 05 Mar 2012 18:27:20 GMT
    Content-Type: text/html; charset="UTF-8"
    Transfer-Encoding: chunked
    Connection: keep-alive
    X-Powered-By: PHP/5.3.10
    Vary: Cookie
    Location: /2011/01/29/compost/
    
    user@host ~ $ curl -i http://www.storyofstuff.org/2011/01/29/compost/
    HTTP/1.1 301 Moved Permanently
    Server: nginx
    Date: Mon, 05 Mar 2012 18:27:33 GMT
    Content-Type: text/html; charset="UTF-8"
    Transfer-Encoding: chunked
    Connection: keep-alive
    X-Powered-By: PHP/5.3.10
    Vary: Cookie
    Location: /2012/01/29/compost/
    
    user@host ~ $

    Could it be an issue with the database?

    Thank you in advance.

  2. Pothi
    Member
    Posted 2 years ago #

    If you could post your nginx configuration, that might help me/us to find if the issue is with nginx.

  3. Keith
    Member
    Posted 2 years ago #

    Thanks for the response. We figured out that it was not the nginx configuration but they had installed the Redirection plugin that had mistakenly assigned the 2011/01/29 to redirect to the 2012/01/29 which was also redirecting to 2011/01/29. Just figured it out yesterday.

    Thank you for the follow-up!

  4. Pothi
    Member
    Posted 2 years ago #

    You are welcome. Glad to learn something about "Redirection" plugin. Thanks for sharing the root cause of this issue.

Topic Closed

This topic has been closed to new replies.

About this Topic