I have a site on win34. When I add this section in web.config, I get an error:
<system.webServer>
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" path="/index.shtml" responseMode="Redirect" />
</httpErrors>
</system.webServer>
Pages work normally, but when I try a non-existent page (to test the 404 redirect), the server responds with “The page cannot be displayed because an internal server error has occurred.”
I don’t have any error pages set up in HSphere.
Am I doing something wrong? Theoretically it should work, if win34 is IIS7.
It can, but it is verrrrrrryyyy picky about syntax and settings. In reality hsphere is doing same edit just in applicationhost.config id guess you have a minor error here in config so it freaks out and doesnt work. This is not uncommon.
Did some testing, and found that the presence of section in <system.webServer> will cause an error if a 404 or other http error is encountered. It seems to ignore the section in <system.web> altogether. But that’s ok, HSphere is fine for that.
However, one can still define SMTP defaults and squee URL rewriting! In fact, if you set a 404 document in HSphere, the url rewrite rule in web.config supersedes it, if the missing page matches the rule. That’s great, I’d prefer web.config to have the power.