Prevent URL Rewrite rules from being inherited by subdirectories in IIS7

Solution 1:

Found the answer after 4.5 hours of Googling!

http://runtingsproper.blogspot.co.uk/2010/04/solved-breaking-parent-webconfig.html

Basically taking advantage of

<location path="." inheritInChildApplications="false"> 
    <system.webServer>
        <!-- ... -->
    </system.webServer>
</location>

Solution 2:

I recently ran into this problem, in a similar situation. But the answer from rjenkins would seem to cause problems with virtual applications that relied on inheritance of parent settings.

If you know the name of the rewrite rule you can just do this:

<rewrite>
  <rules>
    <remove name="RewriteNameToDisable" />
  </rules>
</rewrite>