Forum Moderators: phranque
I'm new to administrating web servers, and I've found today that when I go to a page that doesn't exist, Apache is saying 200 OK, but then also says "The requested URL /whatever.html was not found on this server." Which, of course, makes no sense and is totally silly.
I'm running mod perl, mason and php. Help?
The most common cause for this is an incorrect URL-path specification of the ErrorDocument directive. That is:
ErrorDocument 404 http://example.com/404.html will return a 302 foloowed by a 200, whereas
ErrorDocument 404 /404.html will return the expected 404 response.
This behaviour is described in the Apache core ErrorDocument documentation.
Jim
HTTP/1.x 200 OK
Date: Tue, 12 Sep 2006 23:26:51 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.6 mod_perl/1.29 mod_ssl/2.8.16 OpenSSL/0.9.7d
Keep-Alive: timeout=15, max=93
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
Any other tips? Thanks in advance.
If it is a straight static html page URL, then your server is broken. If it is a script URL with appended variables, then Apache will only determine that the script exists; detection and handling of non-existent or invalid query string parameters will be up to the script, and it's possible that the error-handling in the script is faulty, and that it outputs the incorrect server response code.
Jim
[thoth...]
It's not a script and you could plug any page name in there -- if the page doesn't exist, it will give the results described above.
I'm not sure what you mean by the server is broken. Of course it is! I'm trying to figure out how to fix...?
Thanks again for your responses.
That was not clear until you answered my question about whether the pages were static or dynamic. This is a common point of confusion, in that Apache cannot check the validity of dynamically-generated pages, if those pages are generated based on a query string. Only the script can do that.
You'll need to review your server configuration in httpd.conf, conf.d, and all .htaccess files in the path to the highest-directory-level (non-existent) pages that exhibit this behaviour. Look for unexpected proxy passthrough invocations, Alias, Redirect, or mod_rewrite directives that may be getting involved in the serving of these pages. Also, if content-negotiation is currently on (See "Options MultiViews" in Apache core docs) and you don't use it, then turn it off.
Jim