This tip will show you how to enable or disable directory Browsing in IIS 7 and below .
IIS supports a directory browsing mode where you can view a list of files and directories instead of viewing an web page (HTML page).
This is very useful for tip when you have a lot of folders and files and such as an music file (.mp3)collection.
To enable this mode you select either a Physical or Virtual directory in the Internet Information Services (IIS) application and select properties and then select the Directory Browsing check box as shown below.
Enable or Disable Directory in IIS 6
Hiding Files
If you don’t want to show or use some files or folder in your directory browsing, you must hide the files using Windows Explorer file properties dialog.
Note: If you mark the file as hidden even if you know the name of the file you can not download the file (an HTTP 404 error will be produced)
Why do my Virtual Directories not show up in the browse list?
In the example above we have a virtual directory called Music which is pointing to D:\music (directory browsing has been enabled for the Web Site Root and also for the Music Virtual directory)
When you browse the web site you do not see the Music Virtual directory.
This is a special case where IIS does not show the virtual directory but if you knew the name of the virtual directory and manually entered it into the address bar you would see the files as shown below.
The way to make sure your users can see the virtual directory while they are browsing the root is to create a physical directory with the same name in the physical folder of the parent directory.
So in our case our parent directory points to c:\inetpub\websites\directorybrowsing so we must create a folder called Music in the c:\inetpub\websites\DirectoryBrowsing folder.
Nothing has to exist in this new empty Music directory and as soon as you create the folder and refresh the listing you will see the directory shown in the web browser and you have the ability to navigate into it as we would any other directory.
Enable Directory Browsing in IIS 7
- Connect to your server via Remote Desktop.
- Open IIS; Click Start > Administrative Tools > Internet Information Services (IIS) Manager
- Expand the servername and then expand Sites to drop down the hosted sites
-
Select the site you wish to enable directory browsing for or folder beneath