Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my MVC 3 app, I'm trying to show custom 404 pages. I've got the 403 pages to work, by returning a HttpStatusCodeResult. However, 404's are handled by MVC, and evidently, something is being done differently. Here's my configuration.

    <customErrors mode="RemoteOnly" defaultRedirect="/Pages/Error.aspx" redirectMode="ResponseRewrite">
        <error statusCode="404" redirect="/Pages/404.aspx" />
        <error statusCode="403" redirect="/Pages/403.aspx" />
        <error statusCode="500" redirect="/Pages/error.aspx" />
    <httpErrors errorMode="Custom">
        <remove statusCode="403" />
        <remove statusCode="404" />
        <remove statusCode="500" />

        <error statusCode="403" path="/Pages/403.aspx" responseMode="ExecuteURL" />         
        <error statusCode="404" path="/Pages/404.aspx" responseMode="ExecuteURL" />
        <error statusCode="500" path="/Pages/errors.aspx" responseMode="ExecuteURL" />

This is on my dev machine at the moment: IIS 7.5 on Windows 7

Any suggestions on the right way to configure this?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.