How to get custom error pages working for classic ASP with integrated IIS 7 pipeline

I am working on a website with classic ASP ASP pages (with transition to ASP.NET as needed) and new ASP.NET pages. Using IIS 7 Integrated Pipeline really helped us in our configuration. For example, we were able to obtain automatic authentication of forms using classic ASP pages simply by setting up the appropriate sections of the web.config file (i.e., no changes were required on the classic ASP pages, see the this section for more details ).

My colleague believes that custom error pages, as indicated in the web.config <customErrors> section should also be automatically applied to classic ASP pages, but for our site it only works for ASP.NET pages. I was also unable to find any information describing the possibility of applying custom error pages to a classic ASP with an integrated IIS 7 pipeline.

Can I apply custom error pages to classic ASP pages for web.config for a website running IIS7 with an integrated pipeline? If so, how?

+3
source share
1 answer

IIS7 <system.webServer>, <customErrors> <system.web>, ASP.NET:

<configuration>
    <system.webServer>
        <httpErrors>
            <error 
               statusCode="500" 
               subStatusCode="100" 
               path="/500errors.asp" 
               responseMode="ExecuteURL" />
        </httpErrors>
    </system.webServer>
</configuration>

, ASP.NET. .NET 3.5 , Response.TrySkipIisCustomErrors ASP.NET( if MVC), IIS (-) ASP.NET:

Response.TrySkipIisCustomErrors = true // ASP.NET Forms

:

IIS 7, 500

+3

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


All Articles