WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 404 headers sent on pages with #anchor (2 posts)

  1. dosa
    Member
    Posted 7 years ago #

    Hi

    I have a variant of
    http://wordpress.org/support/topic/74461

    Seen on WordPress 2.0.5, Apache 1.3.33, PHP 5.1.6, MySQL 5.0.24a
    and on WordPress 2.0.4, Apache 1.3.37, PHP 4.4.4, MySQL 5.0.24.

    All my pages are being served fine & I wouldn't know of any problem except that I used curl to resolve another issue. I discovered that URLs ending with a page anchor (hope that's the term) such as #comments are returned with a 404 HTTP header, and the same URL without the #comments is returned as 200 as it should be. The named anchors do exist in the page and are found by the browser.

    I'm using permalinks such as /%year%/%monthnum%/%postname%/

    The sites are on internal servers so can't pass out eg links, sorry.

    I'd be grateful for any thoughts, thanks.

  2. dosa
    Member
    Posted 7 years ago #

    Ok, I'll reply since nobody else has! ;-)

    I misreported the problem: when I was getting 404s in curl they were indeed true 404s, with my page-not-found template being returned. The problem seems to lie in how the command line utility curl does its HTTP request:

    If I want URI:

    http://blah.com/foo/#somewhere

    Browsers seem to just send:

    GET /foo/ HTTP/1.1

    (and deal with the #somewhere internally I presume) whereas Curl sends the full:

    GET /foo/#somewhere HTTP/1.1

    and this confuses wordpress, which can't then find any posts.

    Confused me too! Grrr.

Topic Closed

This topic has been closed to new replies.

About this Topic