IIS 7 and Above
Autogenerated 404 page?
Last post Oct 18, 2019 03:05 PM by stripeycat
Oct 17, 2019 08:48 AM|stripeycat|LINK
Hello IIS General Forum,
I'm currently scratching my head over what looks like an automatically generated error page coming out of the IIS server where my website is hosted.
I have created custom 40x pages and directed to these in the IIS Manager on the virtual machine where it resides, but i can input a garbage URL and a completely different 404 page is presented.
Here is the 404 page that i've created with all of the correct linkages (the way it should look)
And here is the mystery page that i cannot locate within the IIS system.
I am guessing that this can be targeted from within IIS somewhere? Unfortunately i am more familiar with good old htaccess, and as such i am very wary of going haring around the IIS user interface as i have successfully busted it once. Could anyone point
me in the correct direction or is this an engineer's domain?
Oct 18, 2019 05:36 AM|Yuk Ding|LINK
You are pushing the 404 page for a MVC? webform? or just a static website? Could you explain how did you set the 404 page for your webpage?
The mystery page looks like the un-rendered style of your 404 page. So it looks like some static source file are not loaded correctly.
What error message did you see in web browser F12 developer tool->console? Please ensure the error page are loading source files correctly.
Oct 18, 2019 09:56 AM|stripeycat|LINK
This is just for our static website. We set the 400 documents within a module in the IIS Manager on the VM that hosts our site. Here is a capture of the current page setup for this build:
It does appear to be a linkless version of a 404 - but what i don't understand is, where is it being generated from? I thought that we had covered these error slides by defining their location in the webroot above.
Oct 18, 2019 03:05 PM|stripeycat|LINK
The IIS system does not appear to respect relative links within our 40* documents as specified within the IIS Error Documents module.
This means that if a user were to step one directory forward - for example, from
www.website.com/subdirectory/index.html to www.website.com/subdirectory/subdirectory/index.html then although the semantic content - the HTML - would be delivered on the page, relative links to cs,
scripts and images are not respected.
So what we were seeing was the correct 404 HTML content with broken style, script and image linkages.
The solution: add absolute URL links to stylesheets / scripts / images within our 400 pages.