Sunday, January 23, 2011

Get directory listing in IIS when default document exists

How do i get directory listing on IIS when default.aspx exists in that directory

  • If you are using IIS 6.0, remove "default.aspx" from the listings in the "Documents" tab. Make sure that "Directory Browsing" is checked in the Home Directory tab.

    If it is IIS 7.0, let me know and I'll look up the settings there.

    From kcb263
  • Aside from removing or disabling the default.aspx file? Not sure there is a way. Rendering the HTML as opposed to the index is the designed behaviour.

  • For IIS 6, you will need to enable Directory Browsing and remove all document's from Document tab.

    For IIS 7, you will need to add the following in the web.config file under the parent directory i.e. C:\inetpub\wwwroot

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <directoryBrowse enabled="true" />
            <defaultDocument enabled="false" />
        </system.webServer>
    </configuration>
    
    From Vivek
  • The presence of default.aspx does not control directory browsing. If you have a default document defined (regadless of the directory browse setting) clients will connect to the page defined in default documents, if no other page is requested. If directory browsing is enabled and no default document is specified the client will recive a directory list.

    From Jim B

0 comments:

Post a Comment