According to Microsoft's documentation, for static (i.e. HTML) content, web.config should read responseMode="File" for each error.

Currently, my web.config includes

<httpErrors errorMode="Custom">
    <!-- remove statusCodes -->
    <error statusCode="404" path="/error/404.html" responseMode="ExecuteURL" />
</httpErrors>

This returns the correct custom error page, but returns a 200 OK status code.

When I change "ExecuteURL" to "File", my server does return a 404, but the custom error page is not displayed. Instead, I get the message "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

How is web.config supposed to read, to return a static file, but also a 404?

Edit: removed <customErrors> questions after learning that that tag is for IIS <= 6.0

Edit
Report