Custom Error Page Asp.net Not Working
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might custom error not redirecting have Meta Discuss the workings and policies of this site About customerrors redirectmode Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting asp.net mvc custom error page ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million set custom error page in web.config mvc programmers, just like you, helping each other. Join them; it only takes a minute: Sign up CustomErrors does not work when setting redirectMode=“ResponseRewrite” up vote 61 down vote favorite 19 In a old site, I was changing the way that CustomErrors works by adding redirectMode="ResponseRewrite" (new in 3.5 SP1) The thing is that it shows
Custom Error Redirect Not Working
me the generic error page (the one that you get when you don't set customErrors
you're not alone. It's surprisingly difficult to do this correctly, not helped by the fact that some errors are handled by ASP.NET and others by IIS.
Asp.net Custom Error Page
Ideally (and I expect such is the case with some other frameworks/servers) httperrors we would just configure our custom error pages in one place and it would just work, no matter how/where httperrors errormode custom the error was raised. Something like:
404 Page Not Found
I created a new ASP.NET MVC 5 application using the standard template in Visual Studio. If I run the site and try to navigate to a resource that does not exist e.g. /foo/bar, I'll get the standard ASP.NET 404 page with the following information: Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /foo/bar Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.33440 Not exactly friendly, is it? In this case the error was raised by ASP.NET MVC because it could not find a matching controller and/or action that matched the specified URL. In order to set up a custom 404 error page add the following to web.config insideASP.NET Community Standup Forums Help Home/ASP.NET Forums/General ASP.NET/Configuration and Deployment/Custom Errors for 404 pages not working in web.config Custom Errors for 404 pages not working in web.config [Answered]RSS 9 replies http://forums.asp.net/t/1521191.aspx?Custom+Errors+for+404+pages+not+working+in+web+config Last post Nov 10, 2010 04:13 AM by vinu113 ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Support Options Advanced Search Reply dratcha None 0 Points 23 Posts Custom Errors for 404 pages not working in web.config Feb 02, 2010 02:05 PM|dratcha|LINK For some reason the Custom Errors for 404 pages are not working on custom error my production server, but they work fine on development. Instead of going to the custom 404.aspx page, it goes to the ugly IIS 404 page. Here is my Custom Errors protion of my web.config: