forcing error documents

From: Date: Wed, 09 May 2001 16:09:18 +0000
Subject: forcing error documents
Groups: php.general 
Request: Send a blank email to php-general+get-52132@lists.php.net to get a copy of this message
I'm trying to force arbitrary errors in the HTTP header like so: header('HTTP/1.1 404 Not found.'); It's not working like I expected. I found a few discussions of this on this list that said that this did not work with PHP 3, but I've found nothing about PHP 4. The manual says that you should do this on PHP scripts that are meant to serve as 404 (or other error) pages, and as I'm not an expert in HTTP, I gather that this means that such an error header doesn't redirect the user or throw an error on the client -- it's just a hint telling the browser that this is an error page. So, I'm guessing that you'd have to do web server-specific stuff to get this to work -- that is, to get it to behave exactly the way Apache would on its own with a 404 (whether that's redirecting or otherwise). Anyone get this to work? Or anyone know what will work? Or why specifically it won't work? Thanks. Dean.

« previous php.general (#52132) next »