andrewdavey/NotFoundMvc — Issue #11: Convert the 403.14 error generated by /Controllers and /Content into a 404 error
Author: stevejay
Created: 2012-01-14 18:49:49+00:00
State: open

It is possible to add an HTTP Errors mapping to a site's root Web.config file that maps the HTTP status code 403.14 to the /notfound error page, in order to give a 404 response for the /Controllers and /Content URLs. I believe that the HTTP/1.1 specification allows for this, due to the definition of a 403 response:

> 10.4.4 403 Forbidden

> The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.

The key is that a 403 response has a different meaning to a 401 Unauthorized error, since the latter means you could authorize and try again but the former means doing so would not make any difference.