WordPress.org

Ready to get started?Download WordPress

Forums

response headers buggy (6 posts)

  1. anatman
    Member
    Posted 6 years ago #

    I have a problem with response headers since version 2.0. Since i want post versioning, i decided to wipe my installation and start from scratch with a clean, brand new 2.6 install - but the problem is still there! The only differences from a standard install is the blog home is the root, WP is in it's directory, and i use permalinks.

    When i access my homepage or any existing page, say, the about page, the headers look fine:

    Date: Wed, 23 Jul 2008 03:52:34 GMT
    Server: Apache/2.0.54
    X-Powered-By: PHP/4.4.8
    X-Pingback: http://fitoterapia.pro.br/wordpress/xmlrpc.php
    Vary: Accept-Encoding
    Content-Encoding: gzip
    Content-Length: 1876
    Keep-Alive: timeout=5, max=99
    Connection: Keep-Alive
    Content-Type: text/html; charset=UTF-8
    
    200 OK

    But when i access a non-existing page, like this one the response headers look wrong (see the last line, shouldn't the text say Not Found?):

    Date: Wed, 23 Jul 2008 03:54:58 GMT
    Server: Apache/2.0.54
    X-Powered-By: PHP/4.4.8
    X-Pingback: http://fitoterapia.pro.br/wordpress/xmlrpc.php
    Expires: Wed, 11 Jan 1984 05:00:00 GMT
    Cache-Control: no-cache, must-revalidate, max-age=0
    Pragma: no-cache
    Last-Modified: Wed, 23 Jul 2008 03:54:58 GMT
    Vary: Accept-Encoding
    Content-Encoding: gzip
    Content-Length: 1382
    Keep-Alive: timeout=5, max=100
    Connection: Keep-Alive
    Content-Type: text/html; charset=UTF-8
    
    404 OK

    How come it says "404 OK"?

    The installation is fresh, no plugins, the server is Media Temple. I use the permalinks structure /%category%/%postname%/, and htaccess is just the one WP provides for that:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    This problem also causes existing pages not generated by WP to have a 404 response header (say if i put a html file somewhere in my direcotry structure and link to it).

    All help will be much appreciated.

  2. hotkee
    Member
    Posted 6 years ago #

    Depends on what you are using to look at the response headers. http://web-sniffer.net seems to indicate proper content in response.

  3. anatman
    Member
    Posted 6 years ago #

    Hi hotkee, thank you for your answer.

    I was using the Firefox plugin called WebDeveloper. What puzzles me is that if you go for example to Matt's website, the response headers show a status code of 200 OK as expected, and if you try a non-existing page there the status code will be 404 Not Found (attention to the text). This is generated by WP. So, why would my 404 page return a 404OK header? (all this using Firefox WebDeveloper).

    I tried your suggestion, web-sniffer, but the status codes it reports contain no text, just the number. The numbers look right, but they look right when i use Firefox too.

    The answer i am looking for is: since it is WP generating the status code numbers and text, how come it generates the correct numbers but the wrong text? How come it is so for me, but not for everyone?

  4. anatman
    Member
    Posted 6 years ago #

    anyone :-) ?

  5. anatman
    Member
    Posted 6 years ago #

    bump?

  6. anatman
    Member
    Posted 5 years ago #

    To those plagued by this: the problem is PHP4 running under (Fast)CGI. Solution: use PHP5 or PHP as a module.

Topic Closed

This topic has been closed to new replies.

About this Topic