Custom HTTP error pages for images?

I know that for pages I have to redirect to the page user errors for 404 errors, etc. But say that someone opens the URL in their browser for an image that does not exist, for example http://mysite.com/nothinghere.gif . This site returns a 404 error, but it is not only the default browser, but also a custom 404. How do you configure an ASP.NET site on IIS7 for this? The customerrors section of web.config doesn't seem to apply to things like images, css, js, etc.

+3
source share
2 answers

customErrorsthe section will apply to resources managed by ASP.NET. IIS7 has its own section httpErrorsunder the node web server. Of course, there is a user interface for setting it up. In any case, the error handling behavior also changes based on the fact that you are running the ASP.NET application in classic mode or in integrated mode. I suggest you read the following articles to understand this.

http://www.braintrove.com/article/46 - this will tell you how to set up your own IIS7 error error pages

The following explains IIS7 error handling

http://learn.iis.net/page.aspx/267/how-to-use-http-detailed-errors-in-iis-70/ http://blogs.iis.net/ksingla/archive/2008/ 02/18 / what-to-expect-from-iis7-custom-error-module.aspx

+2
source

Source: https://habr.com/ru/post/1784010/


All Articles