Click to See Complete Forum and Search --> : 404 Header


artemis
05-11-2008, 02:10 PM
Hi,

I'm putting this as the first lines of my php file:

header('Status: 404 Not Found');
header('HTTP/1.1 404 Not Found');
exit;

but the page is just showing nothing and not the 404 php page that i have a mod_rewrite set too, any ideas why this iss happening?

Cheers

caraokes
05-11-2008, 02:38 PM
jjjj

NogDog
05-11-2008, 03:18 PM
I believe the issue is that when an invalid page request comes in, it is the web server that does the redirect to the error page (and sends a 404 header). But when your PHP script sends the 404, you have already gotten past that portion of the web server processing. You could, however, have your script do a "Location" header() to your 404 page (which you might want to be a PHP page as well, so it can set its own 404 header).

artemis
05-11-2008, 08:22 PM
I see, that sort of makes sense. Whats the point of the header then? Where does the 404 response get sent?