Custom error pages shown using IIS6, not web.config settings

This is my first post in this great source of programming information.

I have developed a new website for the client and am doing some finishing touches.

I am trying to create custom error pages that will be read from web.config

 <system.web>
 <customErrors mode="RemoteOnly">
           <error statusCode="404" redirect="404.aspx" />
           <error statusCode="500" redirect="500.aspx" />
    </customErrors>

It works well on the local development machine, and 404 and 500 errors are displayed as needed.

After compiling and publishing the site on a web server, it does not work. IIS 6 continues to display the original IIS 6 error pages, such as 404 error:

The page cannot be found

The page you are looking for might have been removed, 
had its name changed, or is temporarily unavailable. 
Please try the following:

Make sure that the Web site address displayed in the address bar of 
your browser is spelled and formatted correctly.

If you reached this page by clicking a link, contact the Web site 
administrator to alert them that the link is incorrectly formatted.

Click the Back button to try another link.
HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)

I'm not sure why he does this, I thought web.config was overwriting the original IIS6 settings.


, , 404.aspx-. 500 500.aspx. 404.aspx. ,

+3
1

- IIS6, .NET ISAPI - , , .aspx

, .NET ISAPI, web.config.

+2

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


All Articles