0
kicks
ASP.NET Custom Errors: Preventing 302 Redirects To Custom Error Pages
Defining custom error pages is a convenient way to show users a friendly page when they encounter an HTTP error such as a 404 Not Found, or a 500 Server Error. Unfortunately ASP.NET handles custom error pages by responding with a 302 Temporary redirect to the error page that was defined. In this post I explain how to create a custom HttpModule that allows you to use custom error pages while preserving the original HTTP status code and avoiding the 302 redirect to the error page.