• 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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Depends on what you are using to look at the response headers. http://web-sniffer.net seems to indicate proper content in response.

    Thread Starter anatman

    (@anatman)

    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?

    Thread Starter anatman

    (@anatman)

    anyone 🙂 ?

    Thread Starter anatman

    (@anatman)

    bump?

    Thread Starter anatman

    (@anatman)

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘response headers buggy’ is closed to new replies.