PHP header() ignored

QuantumNet

Well-Known Member
#1
I use mod_rewrite to rewrite URLs. If the receiving index.php doesn't find content to serve for the URL, it issues something along the lines of:
header("HTTP/1.0 404 Not Found");
file_get_contents('404.html');
the problem is Litespeed does not recognise this as a 404 error and the browsers do not either.

This works fine on Apache.



--Stephen
 

mistwang

LiteSpeed Staff
#2
It should work, at least it should display a 404 error page.
Have you checked the reply with firebug? What do you get with litespeed?

With Litespeed, you can do it in another way.

Only put

Code:
header("status: 404" );
in PHP, then add a custom 404 error page pointing to 404.html .
 
Top