rlange - 4:15 pm on Jul 19, 2012 (gmt 0) [edited by: rlange at 4:29 pm (utc) on Jul 19, 2012]
It doesn't work because 404 is not a valid response code for redirects. The browser sees the 404 response code and just stops there.
You want to do something like this:
header( 'HTTP/1.1 404 Not Found' );
include( $_SERVER['DOCUMENT_ROOT'] . '/404.php' );
Adjust the path to
404.php as necessary.
[edited by: rlange at 4:29 pm (utc) on Jul 19, 2012]