I created a custom error page in PHP that I want to handle all my 404 errors (error.php). It logs the requested page and displays a nice message to the user. I have set error.php as the URL that IIS should serve in the event of a 404 error.
error.php displays correctly (is parsed) when I enter a non-existent url but when I check the response headers I find a 200 response code.
When I use the header( ) function to send a 404 response code from error.php, calling a non-existent page results in a 404 response code (which is what I want) but no html is sent (which is not what I want).
I am running PHP 5.2 as a fast-cgi on IIS 6 on windows 2003 server. I have full access to the server.
Does anyone know how to get IIS to return both the custom error page and a 404 response code?
Is it possible that IIS thinks that error.php does not exist because it is sending a 404 code?