Forum Moderators: coopster
I tried the following code on a test page:
header("HTTP/1.0 404 Not Found");
This works. However, there is the snag. I have a custom 404 error page which is set up in htacess. I thought that the htacess line "ErrorDocument 404 /error404page.php" would take effect here and display the custom 404 page, but apparently, the "header" statement bypasses that and insists on displaying the "real" 404 page.
Is there a way I can force it to execute the ErrorDocument function so that the server returns a 404, yet displays my custom 404 error page. (I don't want to just display the custom page without issuing a 404, or else the Search Engines will not understand the link is truly broken.)