Disable directory browsing in IIS 8

Discussion in 'Windows / IIS' started by Polybius, Mar 11, 2013.

  1. For sites still hosted in IIS 7, DiscountAsp.net has a handy IIS tool for enabling/disabling Directory Browsing.

    But, now, for new sites hosted in IIS 8, the tool is no longer available.

    What to do?

    One way to solve that is by downloading an IIS Manager - Remoting tool from Microsoft, and then using that tool, as described in this Knowledge Base article:
    http://support.discountasp.net/KB/a1067/how-to-connect-to-the-server-using-the-microsoft-iis-manager.aspx

    But another to do it, much easier, is to use web.config.

    Frank, of the DiscountAsp.net team, helped me with this:

    Code:
    <configuration>
    <!-- :::::::: PREVENT DIRECTORY BROWSING ::::::::::: -->
      <system.webServer>
        <directoryBrowse enabled="false" />
      </system.webServer>
    
    </configuration>
    Many thanks to DiscountAsp.net and Frank.
     
  2. martino

    martino DiscountASP.NET Staff

    Very cool I'm sure it will help someone else having the same problem.

    Another thing worth mentioning... Before you can create default documents through the IIS Tools in the control panel. Now, since your on a IIS 8 server the control panel has changed.

    If you want to create a default document on IIS and you're on a IIS 8 server. You will to connect to your site using IIS Manager and double click on the "Default Document" icon within IIS Manager. Then you can go ahead and create any default document you wish to use for your site.
     

Share This Page