Originally posted by Durbs
View Post
The point is that IIS, Apache or any other web server can serve a custom error page at the original URL. Using a redirect to take the client off to a completely different URL is just plain wrong, yet seems to be the only method allowed by ASP.NET.
Suppose, for example, that I type example.com/fo.htm into my browser's location bar. I get a nice friendly 404 page, and realise that it's a simple typo - I correct the location bar to read foo.html, and I'm done. That's not possible if the server has used a redirect, rather than serving the error in place. Instead I have to delete errorPage.html (or whatever) before I can correct the typo.
There is simply no good reason for redirecting errors to a different URL. RFC 2616 states that, in the case of client error (e.g. 404 Not Found) "the server SHOULD include an entity containing an explanation of the error situation" - it says nothing about serving an entity at a different location, and the fact that this is not explicitly forbidden doesn't make it acceptable.
It definitely makes no sense for a request that should return 404 Not Found to instead return 302 Found, which redirects to a page that returns 404 Not Found, when quite clearly the page redirected to has been found, and it was the page doing the redirection that was not found

Edit: yes, I've checked, and yes, that's what it does


)

Comment