Use the <location> tag in web.config to describe the settings for folders within the application.
I have a web application set up in c:\inetpub\myapp, aka http://localhost/myapp. A snippet from web.config is illustrated here:
The following screen shot illustrates the default behavior:
Piece of cake, huh? For the brief testconfig.aspx source code, visit the following link.