Improper HTTP Status Code Returns
-
I’m having a problem with any query to
wp-rss2.phpthat comes via mod-rewrite generating a 404 http status code. However, the problem is a bit more complex than that. My test file setup will probably explain better:To show this error, I created a .htaccess in my home directory, as follows:
RewriteEngine On
RewriteBase /
RewriteRule ^foo/?$ /blog/wp-rss2.php [QSA,L]
RewriteRule ^bar/?$ /test.php [QSA,L]
If you are to load in a web browser, both a http://mroth.info/foo/ and http://mroth.info/bar/ appear to load normally. However, this is not the case. If you examine the headers, you will see the following:
$ curl --head http://mroth.info/test.php
HTTP/1.1 200 OK
Date: Sat, 07 Jan 2006 22:06:09 GMT
Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e
X-Powered-By: PHP/4.3.10
Content-Type: text/html$ curl --head http://mroth.info/bar/
HTTP/1.1 200 OK
Date: Sat, 07 Jan 2006 22:01:40 GMT
Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e
X-Powered-By: PHP/4.3.10
Content-Type: text/html$ curl --head http://mroth.info/blog/wp-rss2.php
HTTP/1.1 200 OK
Date: Sat, 07 Jan 2006 22:02:43 GMT
Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e
ETag: "1b073357af12abd921fea77ba1d7c443"
X-Pingback: http://mroth.info/blog/xmlrpc.php
X-Powered-By: PHP/4.3.10
Last-Modified: Mon, 19 Dec 2005 03:49:23 GMT
Content-Type: text/xml; charset=utf-8$ curl --head http://mroth.info/foo/
HTTP/1.1 404 Not Found
Date: Sat, 07 Jan 2006 21:23:44 GMT
Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e
X-Pingback: http://mroth.info/blog/xmlrpc.php
X-Powered-By: PHP/4.3.10
Content-Type: text/xml; charset=utf-8
So, in other words whereas the
wp-rss2.phpwill load fine as itself, when called via redirect, it loads and displays fine, but returns a HTTP 404 status code, which causes many aggregators to break. The problem seems to be specific to that file, since as you can see the/bar/redirect to a test .php file functions normally. Thus, the problem appears to be WordPress specific. This is causing large problems with aggregators for me, anyone have ideas?
The topic ‘Improper HTTP Status Code Returns’ is closed to new replies.