title: How to make custom error pages work in ASP.NET MVC 4
body: <p>I want a custom error page shown for 500, 404 and 403. Here's what I have done:</p>
  
  <ol>
  <li><p>Enabled custom errors in the web.config as follows:</p>
  
  <pre><code>&lt;customErrors mode="On" 
                defaultRedirect="~/Views/Shared/Error.cshtml"&gt;
  
      &lt;error statusCode="403" 
             redirect="~/Views/Shared/UnauthorizedAccess.cshtml" /&gt;
  
      &lt;error statusCode="404" 
             redirect="~/Views/Shared/FileNotFound.cshtml" /&gt;
  
  &lt;/customErrors&gt;
  </code></pre></li>
  <li><p>Registered <code>HandleErrorAttribute</code> as a global action filter in the <code>FilterConfig</code> class as follows:</p>
  
  <pre><code>public static void RegisterGlobalFilters(GlobalFilterCollection filters)
  {
      filters.Add(new CustomHandleErrorAttribute());
      filters.Add(new AuthorizeAttribute());
  }
  </code></pre></li>
  <li><p>Created a custom error page for each of the above messages. The default one for 500 was already available out of the box.</p></li>
  <li><p>Declared in each custom error page view that the model for the page is <code>System.Web.Mvc.HandleErrorInfo</code></p></li>
  </ol>
  
  <p>For 500, it shows the custom error page. For others, it doesn't.</p>
  
  <p>Is there something I am missing?</p>
  
  <p>It does look like this is not all there is to displaying custom errors as I read through the code in the <code>OnException</code> method of the <code>HandleErrorAttribute</code> class and it is handling only 500.</p>
  
  <p>What do I have to do to handle other errors?</p>