apache not handling 404 errors for .php pages
| From: | scott [gts] | Date: | Thu, 12 Jul 2001 19:38:51 +0000 |
| Subject: | apache not handling 404 errors for .php pages | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-57635@lists.php.net to get a copy of this message | ||
I have custom 404 error handling setup on my linux apache
box, however, there's a problem with files that have a PHP
extension. it seems that apache itself does not check for the
existence of the requested .php file and fires up PHP no matter
what. if PHP does not find the requested file, it'll bail out
with that dorky looking "Internal Server Error" *NOT* the
custom error handler that apache uses for non-php files....
example: "notexists.html" and "notexists.php" both do not exist
http://server.com/notexists.html
will show me the custom 404 page
http://server.com/notexists.php
will show me the "Internal Server Error", becuase apache fired
up PHP and passed in "notexists.php" without checking for the
existence of "notexists.php" first.
A possible solution that comes to mind is to auto_prepend
a script that will check for the existance of the file
that PHP is attempting to execute, and die gracefully if
it does not exist on the server.... but that would be a bad
kludge hack (if it even works at all)
anyone have a more elegant solution?