How can I trigger the default Apache 404 error from PHP? I don't want
to specify a custom handler, I want the default handler. The reason is
that I am using mod_rewrite with Apache for my site. If certain a
certain page is requested that is not published, then I want to send
the apache default 404 error page. Currently, I am doing this to
return a custom error.
if($pageNotPubl ished) {
header("HTTP/1.1 404 Not Found");
// How do I send the default apache 404 message
// instead of the message below?
print("<html><b ody>HTTP 404 - Not Found</body></html>");
exit();
}
The default 404 error page has more details, and I would rather not
recreate it.
to specify a custom handler, I want the default handler. The reason is
that I am using mod_rewrite with Apache for my site. If certain a
certain page is requested that is not published, then I want to send
the apache default 404 error page. Currently, I am doing this to
return a custom error.
if($pageNotPubl ished) {
header("HTTP/1.1 404 Not Found");
// How do I send the default apache 404 message
// instead of the message below?
print("<html><b ody>HTTP 404 - Not Found</body></html>");
exit();
}
The default 404 error page has more details, and I would rather not
recreate it.
Comment