Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force 404 with header

Status
Not open for further replies.

namida

Programmer
May 29, 2003
101
0
0
AU
Hi...

I'm trying to force a 404 page with

<?
header("HTTP/1.0 404 Not Found");
exit;
?>

I tried this On IIS and also on Apache (under FreeBSD)
but both just gives me a blank page.
i didn't make any custom 404 pages, just hoping that the default ones will show up.
The page only have the above codes and no other output.
If I put print "here"; before exit, it will print "here";

any suggestion?


Regards,

Namida
 
hmm, works fine for me. have you got short tags enabled? if not you will need to put in
Code:
<?PHP 
header("HTTP/1.0 404 Not Found"); 
exit; 
?>
cause it may be that the script is not being run. from what you say about putting in "here" I suspect this is the case when it displays it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top