PHP 404 response header

Bolisaris

New Member
I use .htaccess RewriteRules to pass the url to index.php. If the specified page name isn't found in the database, I want my script to throw proper 404 responses.The way I have tried to achieve this is:\[code\]header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");\[/code\]Analysing the HTTP responses in my browser, the response comes back fine:\[code\]HTTP/1.1 404 Not Found \[/code\]However, I would like to be able to output a friendly 404 page, but anything after the header() function gets disregarded, and anything before ... well ... that'd be stupid.Can anyone suggest how to output a 404 error message from the script?Thanks.
 
Back
Top