I started to make Dr. Wingnut more accessible last night by adding an error page to handle missing page requests, etcetera. As part of that process I created the .htaccess file with the following content:
ErrorDocument 400 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
ErrorDocument 500 /error.php
The error.php file builds a response formatted with the same structure as the rest of the site with an explanation that the doctor must have been out to lunch, and a link back to the home page so it’s not like you fell off the end of the world.
The problem is that the server is not processing a failed request consistently. A request for the non-existent page http://www.drwingnut.info/missing.html takes you to the correct error page, but a request to http://www.drwingnut.info/missing.php takes you to the servers error page that I am attempting to hide. I thought that perhaps the document reference needed to be fully qualified, so I tried the following in the .htaccess file as well, to no avail.
ErrorDocument 400 http://www.drwingnut.info/error.php
ErrorDocument 403 http://www.drwingnut.info/error.php
ErrorDocument 404 http://www.drwingnut.info/error.php
ErrorDocument 500 http://www.drwingnut.info/error.php
The even weirder thing is, that if I use the fully qualified name to the error page, then the "error.php" page comes up when I try to get "missing.html," but the error code is listed as "200" which means "No error/Request processed OK"
Anyone got any ideas?
Leave a Reply
You must be logged in to post a comment.