'custom error page for asp,net webforms does not work for html page
Hi I set the custom error page settings in my aspx web.config file. it works fine if the page url is of extension aspx but if I type an incorrect url without extension or with .html extension then it is not routed to my customer error page (404). The site is hosted as azure app service to note. What am I missing? Should I configure something in azure app service settings? Thank you for your help
Hi, I updated the web. config as follows and it seems to work. However, when I try to check if the 404 custom error page is set up correctly by using SEO checkup tools, it shows that we have no 404 custom error pages. What am I missing? I appreciate your help. Do I need to specify error page url extension like .aspx? or do I need to update anything on my robot.txt?
<system.web>
<httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" path="/page-unavailable" responseMode="ExecuteURL" />
</httpErrors>
</system.web>
<system.webServer>
<httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" path="/page-unavailable" responseMode="ExecuteURL" />
</httpErrors>
<rewrite>
</system.webServer>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
