Generating a 404 status message with header()
| From: | Eric Gorr | Date: | Mon, 08 Aug 2005 20:37:12 +0000 |
| Subject: | Generating a 404 status message with header() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-220253@lists.php.net to get a copy of this message | ||
I've got an ErrorDocument directive defined in my htaccess file.
If I, for example, enter into my browser:
http://mydomain.com/doesnotexist.html
the 404 directive is triggered and 404 document correctly comes up.
I have another file (doesexist.php) with the contents:
<?PHP
header("HTTP/1.0 404 Not Found");
?>
If I enter into my browser:
http://mydomain.com/doesexist.php
I get a blank page. Apparently, this does not trigger the 404 directive.
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.
--
== Eric Gorr =============================== http://www.ericgorr.net ===
"I believe each individual is naturally entitled to do as he pleases
with himself and the fruits of his labor, so far as it in no way
interferes with any other man's rights." - Abraham Lincoln
== Insults, like violence, are the last refuge of the incompetent... ===