ASP.Net MVC Custom Error Pages

Now that I’m using MVC fully it’s time to implement a Customer Error Page.

As ASP.NET MVC is a layer on top of ASP.NET we can still use the same Customer Errors that we are used to in the Web.Config, so just to make it SEO friendly, here is what it can look like:

<customErrors mode=On defaultRedirect=~/Error/Unknown />


Other references worth check out are:

ASP.NET Custom Errors: Preventing 302 Redirects To Custom Error Pages

Better Custom Errors in ASP.NET

404 vs 302 ASP.Net Custom Errors