Re: ErrorDocument doesn't work for PHP scripts

From: Date: Fri, 20 Jun 2003 18:21:43 +0000
Subject: Re: ErrorDocument doesn't work for PHP scripts
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-152323@lists.php.net to get a copy of this message
: ErrorDocument 404 http://www.jeamland.org/_error.html Yep, it does seem to work if I put the whole URL in the ErrorDocument directive rather than just /_error.html ! Unfortunately, that makes the web server snd a redirect which isn't exactly what I want (unless you know of a way to get at the originally requested URL ?) : Or check for the existence of the requested file in the header and if : not found, send the 302 header with a forward to your custom page. I'm not entirely sure that the header is actually being run.. If I move the header out of the way, I don't get any errors about it: >> Browse to www.jeamland.org with header.php removed << [client X.X.X.X] PHP Warning: Unknown(header.php): failed to open stream: No such file or directory in Unknown on line 0 [client X.X.X.X] PHP Warning: (null)(): Failed opening 'header.php' for inclusion (include_path='.:/spool/web/www.jeamland.org/lib') in Unknown on line 0 >> Now browse to www.jeamland.org/bob.html << [client X.X.X.X] script not found or unable to stat What seems to be happening is that apache is seeing the request for a .html file and calling PHP which is returning a set of 404 headers.. For some reason, apache isn't testing for the existence of the file first. I've no idea if this is a PHP or apache problem but hopefully there's a way to work around it Thanks for the very rapid response! Andy

« previous php.general (#152323) next »