You can add the <location> element with the “inheritInChildApplications” attribute to the root web.config. This attribute will prevent child applications inherit some specified configuration from the root web.config.
The attribute must be placed in the <configuration> section of the web.config. It looks like this:
<location path="." inheritInChildApplications="false">
<system.web>
<!–
……
Your settings
–>
</system.web>
</location>
Referance: