Re: Generating a 404 status message with header()
| From: | Sebastian | Date: | Tue, 09 Aug 2005 21:39:33 +0000 |
| Subject: | Re: Generating a 404 status message with header() | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-220298@lists.php.net to get a copy of this message | ||
Jasper Bryant-Greene wrote:
Sebastian wrote:yeah sorry, i must of deleted the original topic and all i had was the followups.. anyway, what do you want, the cake and eat it too? why two types of 404's? i mean you either use ErrorDocument or use php headers.. i guess i dont understand why use both.. to send 404 header and then display a custom document you might as well use the ErrorDocument in apache, it would be the same affect. might as well set ErrorDocument in apache to point to a php file and do whatever you want in the php script.. like send more 404 headers.. -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.4/66 - Release Date: 8/9/2005Paul Waring wrote:I'm afraid you missed the original point of the question. His problem was that Apache does not display the ErrorDocument if PHP sends a 404 status header. This behaviour is by design (Apache checks to see if the PHP script handling the request exists; it does, so Apache does not display the ErrorDocument) What I would recommend is to send the 404 header and then include() the ErrorDocument as specified in Apache's config. JasperOn Mon, Aug 08, 2005 at 04:37:12PM -0400, Eric Gorr wrote:header('HTTP/1.0 404 Not Found');Should it? Is it possible to write a doesexists.php script which would cause the 404 directive to be triggered? I also tried: header("Status: 404 Not Found"); but this did not work either.Try searching the archives for this list, I'm sure this question, or one very similar to it, was asked and answered fairly recently. Paul