Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove error messages - IIS7

Tags:

iis

iis-7

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?

like image 728
RadiantHex Avatar asked Dec 16 '10 10:12

RadiantHex


2 Answers

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>
like image 95
Kev Avatar answered Oct 19 '22 09:10

Kev


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.

like image 23
VinnyG Avatar answered Oct 19 '22 09:10

VinnyG