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

I am having trouble with a custom 404 error page.

I have a domain running a .NET proj with it's own error handling. I have a web.config running for the domain which contains:

<customErrors mode="RemoteOnly">
    <error statusCode="500" redirect="/Error"/>
    <error statusCode="404" redirect="/404"/>

On a sub dir of that domain I am ignoring all routes there by doing routes.IgnoreRoute("Assets/{*pathInfo}"); in the .NET proj and I want to put a custom 404 error page on that and any sub dir's of Assets. The sub dir contains static content like images, css, js etc etc.

So in the Error Pages section of IIS I put a redirect to an absolute URL.

The web.config for that dir looks like the following:

        <remove statusCode="404" subStatusCode="-1" />
        <error statusCode="404" prefixLanguageFilePath="" path="" responseMode="Redirect" />

But I navigate to an unknown URL under that dir and yet I still see the default IIS 404 page.

I am also seeing an alert in IIS that reads:

You have configured detailed error messages to be returned for both local and remote requests. When this option is selected, custom error configuration is not used.

Does this have anything to do with the customErrors mode="RemoteOnly" in the site web.config?

I have tried to overwrite the customErrors in the sub dir web.config but nothing changes.

Any help would be appreciated.


share|improve this question

You can try just add this :

<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/index.php" responseMode="ExecuteURL" />

In your "web.config" file.

share|improve this answer

This may be a little late, however you can put the following in the system.webserver part of the web.config

  <httpErrors existingResponse="PassThrough" />

Credit goes to this entry on Stack Overflow:

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.