IIS Is Evil
By Adrian Sutton
Here’s a tip, if you configure IIS to use a custom 404 error page (or any type of error I imagine) and use the “URL” type, IIS will return 200 OK by default instead of the appropriate error code. This breaks things in very unexpected and often difficult to track down ways.
You can work around it by making sure that the URL you use for the error page is a script of some kind that sets the return code to the appropriate error code again. The default however should really have been to preserve the error code. Sigh. Using “File” or “Default” for the error page works correctly.