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?
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>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With