Forum Moderators: coopster
And, thanks very much, that looks just the ticket ;)
Nick
Hmmmm.... Neither of them work..No, Sorry, they do work but not as expected. The page just hangs, does not show the default 404 page.
Did you actually check the header that gets returned? I bet it had a 404 status. Remember, header() [php.net] only sends the specified header. Apache [httpd.apache.org] does not parse the headers returned by PHP [php.net] before sending out the page and it will not add your default 404 page to your output.
<?php
header("HTTP/1.0 404 Not Found");
include("/var/www/html/site.domain.com/err/404.php");
?>
This will send a 404 header() [php.net] and it will [url=http://www.php.net/include]include() [php.net][/url] your error document.
Andreas
[edited by: jatar_k at 9:46 pm (utc) on Feb. 15, 2003]
stevedob [webmasterworld.com] wrote at 12:28 AM on Feb. 15, 2003 in message #5 [webmasterworld.com]
Do a 'Location:' to a page you know doesn't exist, which should bring up your 404 page.
This will indeed cause Apache [httpd.apache.org] to send the 404 default error page. However, it will indicate that the resource you directed to could not be found, while sending a 404 from the original page will indicate that that resource could not be found. So your suggested solution does not achieve what Nick is after.
Andreas