Skip to:
Content
Pages
Categories
Search
Top
Bottom

tags.php generates a 302 header – Google doesn’t like redirects in the sitemap


  • chrishajer
    Participant

    @chrishajer

    I was checking my Google sitemap stats and saw this recently for my bbPress sitemap:

    URLs not followed

    When we tested a sample of the URLs from your

    Sitemap, we found that some URLs were not accessible

    to Googlebot because they contained too many redirects.

    Please change the URLs in your Sitemap that redirect

    and replace them with the destination URL (the redirect

    target). All valid URLs will still be submitted.

    Further reading led to this:

    http://www.google.com/support/webmasters/bin/answer.py?answer=48551&hl=en

    So my questions are:

    1. What is the reason this is a 302 header (temporary redirect) vs a 301 header (permanent redirect)?

    2. Can it be changed in the code or with a plugin to generate a 301 header so Google will follow the URLs?

    3. If this is not possible, what would the proper permanent URL be for a tag URL like http://www.example.com/forum/tags.php?tag%3Dghosts

    BTW, I am using the Sitemap plugin for bbPress by Richard Boakes. http://boakes.org/talk/topic/31

    I can modify that to write the proper permanent URLs to the sitemap if that’s the easiest way to go about it. Or, maybe tags URLs should not even be in the sitemap (they are just pointers to content that exists elsewhere anyway.)

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

  • _ck_
    Participant

    @_ck_

    I am not sure why Google would be seeing redirects. bbPress only redirects after form submits via wp_redirect to the best of my knowledge. Some plugins do too, but usually again after only form submits. Even tag URLs don’t use redirects.

    Are you saying the sitemap plugin does not generate permalink urls but rather the non-slug type ie. ?topic=123 If so, it’s outdated and if you are using slugs it should be modified to generate results that take advantage of slugs.


    chrishajer
    Participant

    @chrishajer

    Here’s an example of a URL in the sitemap.

    http://www.riversideinfo.org/forum/topic.php?id%3D3%26page%26replies%3D1

    If you do a

    curl -I http://www.riversideinfo.org/forum/topic.php?id%3D3%26page%26replies%3D1 you get a 302 header back. If you URL unencode the URL and do a curl -I, you get back a proper 200:

    curl -I "http://www.riversideinfo.org/forum/topic.php?id=3&page&replies=1"

    I am not using permalinks or slugs, and that plugin author doesn’t seem to have updated it since I installed it long ago. I actually turned it off a while ago because of the amount of time it was taking to generate the sitemap for 5000 posts.

    http://boakes.org/talk/topic/31

    So, I guess the question is, why does that first URL trigger a 302? Maybe the sitemap plugin is creating URLs that are poorly formed?


    chrishajer
    Participant

    @chrishajer

    Sorry, I forgot I was talking about tags.php specifically. Here’s a tags URL.

    http://www.riversideinfo.org/forum/tags.php?tag%3Dtif

    is what’s in the sitemap.

    curl -I "http://www.riversideinfo.org/forum/tags.php?tag%3Dtif"

    returns a 302 header.

    If you unencode it, and then curl -I:

    curl -I "http://www.riversideinfo.org/forum/tags.php?tag=tif"

    returns a 200 header.

    Maybe it’s just the urlencoding of the = that causes it to redirect? That’s the only difference between the two URLs here.


    Sam Bauers
    Participant

    @sambauers

    It’s definitely the URL encoding causing the CURL issues.

    I don’t know enough about the plugin to comment on it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar