PHP as external script and Apache : configuring 404 errors
| From: | Laurent INFOS | Date: | Tue, 03 Jul 2001 14:12:59 +0000 |
| Subject: | PHP as external script and Apache : configuring 404 errors | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-3404@lists.php.net to get a copy of this message | ||
Hello,
I have :
- Apache 1.3.x
- PHP 4.0.5 (not a module, but a separate script)
- the directive ErrorDocument is configurated :
ErrorDocument 404 /404.html
My problem :
- http://server/filenotpresent
gives a 404 error, and open 404.html. It's OK.
- http://server/filenotpresent.php4
calls php before verifying if "filenotpresent.php4"
exists. So, instead of opening /404.html,
we got an internal error because
"/usr/.../bin/php filenotpresent.php4" returns
no data.
My question :
Is there is a way :
- to tell php to generate an HTML page containing a redirect
to /404.html, if the given file doesn't exists
or
- configure Apache to force it to check if the
file exists before calling php ?
Thanks for your help.
Laurent.