WordPress.org

Ready to get started?Download WordPress

Forums

WP sending 301 redirect to exactly same url as was requested (1 post)

  1. djeyewater
    Member
    Posted 2 years ago #

    With some URLs, WordPress is sending a reply of 301 redirect to exactly the same URL as was requested. On the second request it replies with 200 and the page, it doesn't get stuck in a constant redirect loop.

    This is WordPress 3.2.1 with the 2011 theme and no plugins activated.

    The original request that WP replies with a 301 redirect to looks like this:

    [Header responses moderated as per the Forum Rules. Please use the pastebin]

    The subsequent request that WP replies with 200 OK to looks like this:

    [Ditto]
    Note the original request does not include an If-Modified-Since header. This problem is not with all URLs either, it seems to be that for some URLs the browser (Google Chrome) sends the If-Modified-Since header on the first request, and WP serves the page OK. On some other URLs though the browser doesn't send a If-Modified-Since header on the first request, and gets a 301 redirect.

    I have no idea why the browser does not send a If-Modified-Since header with all requests, or if the absence of this header is related to WP replying with a 301 redirect.

    To give an example of a URL that doesn't generate a 301:
    /blog/642-japan-day-1-pt-1-namba-yasaka-shrine.xhtml
    And a url that does generate a 301:
    /blog/644-japan-day-1-pt-7-osaka-castle.xhtml

    I am pretty sure it is WordPress sending the 301 redirect and not the server as the reply includes the headers

    X-Powered-By: PHP/5.3.4
    X-Pingback: http://www.photosite.com/blog/xmlrpc.php

    Anyone have any ideas on what's happening?

    Thanks

    Dave

Topic Closed

This topic has been closed to new replies.

About this Topic