So I have a very basic site that's hosted in IIS (for now just straight raw html with no .Net code)
In my web.config I have the following:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <httpErrors> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" prefixLanguageFilePath="" path="/404.html" responseMode="ExecuteURL" /> </httpErrors> </system.webServer> </configuration>
This was added into the web.config by the IIS manager - and it reflects what I've found online as the valid configuration for 404 errors to redirect to my custom 404 page.
However I still get the IIS generated
HTTP Error 404.0 - Not Found page back whenever I go to a page that doesn't exist.
Any ideas what I'm doing wrong here?
- IIS 10/IIS 8.5 (Tested on both)
- Windows 10/Windows 8.1 (Tested on both)
- Chrome, Edge, Internet Explorer, Firefox (All latest)