Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.

share|improve this question
    
I wanted to add that the response header from the web server is indeed error 503, as seen by Webscarab but I'm being redirected to HTTPS and not correctly just presenting an error like before. Could it be that this is a default rule being triggered to use. –  Sn3akyP3t3 Jul 6 '12 at 0:11
    
Before modification to the web.config file the error pages behaviour was correct. After the modification and restoration back of web.config the incorrect behaviour was experienced. –  Sn3akyP3t3 Jul 14 '12 at 20:54
add comment

2 Answers

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:

  1. Override rules you set in root web.config file by setting them as off or to the value you need.
  2. Use applications (similar to virtual directories) instead of actual directories. The applications will not inherit parent rules.
share|improve this answer
    
That is what I read when I set it up, but the behaviour I'm getting is not correct. Is it possible my web.config file is corrupt or does IIS need to be reset? –  Sn3akyP3t3 Jul 5 '12 at 2:58
    
Anytime you make changes to web.config the site automatically restarts. As for IIS Reset, the command is the same as simply rebooting IIS, or the whole server to make sure. One thing that usually cases errors is the ordering of IIS modules. Is your code calling any specific ones such as ARR –  Frank Jul 11 '12 at 17:14
    
I'll see what the order of modules you mentioned next week. The code is setting the response header, but IIS appears to not be taking the correct action for that particular response header. I probably should be using 403 response, but still I'm puzzled about the 403.4 behaviour presentation. –  Sn3akyP3t3 Jul 14 '12 at 20:52
    
What exactly are you trying to accomplish? 403 is an unauthorized header. I am guessing you are somehow trying to restrict access to certain directories? If you give us an overall picture of what you are trying to do maybe we can diagnose it. One extra now. I have found that child "applications" those that you actually run as applications versus virtual directories need to have their own /bin/ app-code etc folders. That does not cascade up to the parent application. –  Frank Jul 14 '12 at 21:42
    
What I'm using the current 503 response for is with a limiter for unpleasant bot behaviour to mitigate bandwidth consumption and server resources. If a visitor from an IP address requests more than 3 http requests per second they are flagged and blocked for the remainder of that second and then the restriction is released and the process is repeated. Organic traffic isn't affected unless crazy fast clicking from the user is performed. Normally the 503 response is sent to the browser flowed with a message, but now its an https redirect and that is a flaw. –  Sn3akyP3t3 Jul 15 '12 at 4:53
show 6 more comments

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%\system32\inetsrv

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

share|improve this answer
    
Appcmd looks promising to do what I'm intending to do. In the recent past I've leveraged it from Powershell to view current requests. Thanks! –  Sn3akyP3t3 Nov 8 '13 at 3:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.