For the past few months, I've noticed that customized 404 error pages have stopped working on various websites using Internet Information Services 8.5. Instead of displaying the customized 404 error page, IIS displayed its non user friendly default 404 error page. It seems that this issue started occurring after a Microsoft security patch to IIS, however the customized 404 page worked on developer computers that were being used to build these websites. After several conversations with various clients, I concluded that this issue was not due to coding but rather a system configuration issue with IIS within a specific timeframe of a software update. I searched the internet to see if I could find anything concerning this issue and was unsuccessful. Therefore, I figured that I would write a quick post about a specific way to resolve the problem I was experiencing.
Customized 404 error page stops working in IIS after a reboot or a system update and started displaying default IIS 404 page illustrated above.
Customized 404 error page is working on a development workstation but not the Windows server.
Customized 404 error page stops working in IIS and no changes have occurred on the server.
To resolve this issue, I focused on identifying what in IIS could have changed or could be responsible for causing the issue. I felt that the issue was not due to a coding error since no deployments occurred to the servers that reported the issue. I searched the settings within IIS for the site and I identified an icon called “Error Pages”.
It is quite possible that a lot of developers or system administrators would review the options under “.NET Error Pages”, but I knew that this had to be an issue with IIS and not ASP.NET. (I still looked under “.NET Error Pages” just to make sure)
I clicked on “Error Pages” icon, then navigated to “Edit Feature Settings”.
After clicking the "Edit Error Page Settings" link, the system opened up the “Edit Error Page Settings” dialog box. The default option for IIS is “Detailed errors for local requests and custom error pages for remote requests”.
I selected “Detailed errors”, clicked "OK", and then I was able to access the site's customized 404 error page again. Since the last option was selected by default, it explains why the customized error page worked on development computers building the website and encountered problems once it was deployed to a web server outside of the development environment.
In conclusion, it appears that IIS no longer will display custom error pages by default and the second option called "Detailed errors" is now required to ensure that your website will display a customized 404 error page on your web server.