10

I'm wondering how to remove the error messages IIS7 adds to the top of the page.

I have my own 500 and 404 error pages served.

Not needing the error pages I have deleted them, but I am still getting this on top of my page:

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable

Any ideas?

3 Answers 3

17

To prevent IIS7 hijacking your error pages, set existingResponse="PassThrough" in your httpErrors section in your web.config file. For example:

<configuration>
  <system.webServer>
    <httpErrors existingResponse="PassThrough" />
  </system.webServer>
</configuration>
Sign up to request clarification or add additional context in comments.

Comments

9

You can also go into IIS manager --> Error Pages then click on the right on "Edit feature settings..." And set the option to "Detailed errors" then it will be your application that process the error and not IIS.

1 Comment

Is this the equivalent to adding "<httpErrors existingResponse="PassThrough" />" to the weg.config file?
1

Just for addtional information I'll share what helped me:

<system.webServer>
  <httpErrors errorMode="DetailedLocalOnly">
</system.webServer>

In such setup I could see detailed errors when developing on my local machine, but they would not be shown to users when remote server is accessed from outside.

You could find more information regarding errorMode here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.