Mobile app version of vmapp.org
Login or Join
Miguel251

: How can IIS 7.5 have the error pages for a site reset to the default configuration? A mishap occurred with web.config to accommodate a subsite existing. I made use of “<location path="."

@Miguel251

Posted in: #403Forbidden #Error #HttpCode500 #HttpCode503 #Iis7

A mishap occurred with web.config to accommodate a subsite existing. I made use of “<location path="." inheritInChildApplications="false">”. Essentially it was a workaround put in place for nested web.config files which was causing a conflict. The result was that error pages were not being handled properly. Error 500 was being passed to the client for every type of error encountered.

Removal of the offending inheritInChildApplications tag from the root web.config restored normal operations of most of the error handling, but for some reason error 503 is a correct response header, but the IIS server is performing the custom actions for error 403.4 which is a redirect to https.

I'm looking to restore defaults for error pages so that the behavior once again is restored. I then can re-add customizations for the error pages.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Miguel251

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ravi8258870

I've been able to reset a lot of my site's values using appcmd, but I had to dig into specific configurations I wanted to change, which I'll describe a bit below. I know for sure that this works with IIS 7, but I'm not 100% certain whether it passed on to 7.5 so YMMV.

appcmd isn't in my cmd path on any of my installations (though these machines are 2k8sp2) - anyway, from cmd prompt as administrator type:


cd %windir%system32inetsrv


then to get a nice set of examples type:


appcmd reset config /?


and to see which settings you want to reset, type:


appcmd reset config /section:?


The /section:? will give you a big dump, so I dumped it to a text file for my personal needs. You'll end up with up everything in the configs in the namespace system.web, system.webServer, system.net and a handful of others.

The command I ended up using (I needed to reset my httpErrors) is below:


appcmd reset config /section:httpErrors


I hope that's helpful! More info on appcmd here:
at the Microsoft TechNet site

10% popularity Vote Up Vote Down


 

@Pope3001725

Nested directories can have their own web.config file, but like CSS files the rules you set cascade down.

For sub directories with their own web.config settings, Best practice is to:


Override rules you set in root web.config file by setting them as off or to the value you need.
Use applications (similar to virtual directories) instead of actual directories. The applications will not inherit parent rules.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme