How to enable directory browsing with IIS7 web.config
IIS7 includes an all-new distributed configuration option, which allows for IIS7 configuration to be stored in web.config files, along with asp.net configuration, to be deployed with your content. This makes transferring IIS7 configuration from your Vista PC to your hosted server as easy as copying files! Read more about this in the Delegating Configuration section of http://learn.IIS.net
In this post, I'll show how easy it is to enable directory browsing for your Web site or a directory on your site. This method will work on any IIS7 web server, and it will be ignored on all non-IIS7 web servers, so it should be safe to do no matter the type of application or content.
Scenario: Let's say I want to enable directory browsing for a special directory on my site, how do I enable that? It's as easy as:
1) create (or edit) the web.config file in your site's home directory
2) edit it as follows:
<configuration>
<location path="special_directory_name_here">
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer></location>
</configuration>
Note you will need to change the location path to equal the directory name you want to enable directory browsing for. If you want to enable it for the entire site, just remove the entire <location> and </location> tags (which tell IIS7 to scope the configuration changes to just the path specified). Enjoy!
PS:
Hi Bill