title: How do I get ASP.NET MVC to honor my customErrors settings?
body: <p>In the customErrors tag in my web.config, I am pointing to a controller.  In my controller I am redirecting to an external error page that is shared by multiple applications.</p>
  
  <p><code>&lt;customErrors defaultRedirect="~/Error/ServerError" mode="On"&gt;</code></p>
  
  <p>My controller:</p>
  
  <pre><code>public class ErrorController : Controller
  {
  
      public ActionResult ServerError()
      {
          return Redirect("/Systems/ASPNETErrorHandling/ErrorPage.aspx");
      }
  
      public ActionResult ErrorTest()
      {
          throw new Exception("testing error handling");
      }
  }
  </code></pre>
  
  <p>I'm calling Error/ErrorTest to test the error handling. But it always redirects to Views/Shared/Error.cshtml instead of redirecting to the controller I specified.  </p>
  
  <p>How do I get asp.net mvc to honor the defaultRedirect path in my customErrors settings?</p>
  
  <p>UDPATE:  I'm also using ELMAH and overriding the HandleErrorAttribute as described in <a href="https://stackoverflow.com/questions/766610/how-to-get-elmah-to-work-with-asp-net-mvc-handleerror-attribute/779961#779961">this post</a>.  I see from .Net Reflector that the base HandleErrorAttribute is setting Error as the view.  I don't think there's much I can do about it redirecting to Error.cshtml, or some other view.  </p>