Customizing 404 Custom Page in IIS 7 for HTML Pages

I have my site in the .htm extension, and the server is IIS 7. Now I have a page with custom 404 pages.

Now can anyone suggest me how to implement a custom 404 page through web.config.

+6
source share
2 answers

I also had a problem with .htm pages in IIS7 (not ASP, not .NET).

I changed responseMode to File instead of ExecuteURL in <system.webServer> , and it worked:

 <httpErrors errorMode="Custom" existingResponse="Replace"> <remove statusCode="404" /> <error statusCode="404" responseMode="File" path="error.htm" /> </httpErrors> 
+12
source

Use this in the web.config :

 <httpErrors errorMode="Custom" existingResponse="Replace"> <remove statusCode="404" /> <error statusCode="404" responseMode="ExecuteURL" path="/Errors/NotFound" /> </httpErrors> 
+5
source

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


All Articles