How to avoid Directory Level Browsing

Discussion in 'ASP.NET / ASP.NET Core' started by Senor Engineer, May 3, 2014.

  1. Hi,
    I need some help to correct in our website running on DiscountASP.NET. I run VS2008 with ASP.NET 3.5.

    For example, I have the sites with PDF links below:

    http://www.someurl.com/folder1/file-name-1.pdf
    http://www.someurl.com/folder1/file-name-2.pdf
    http://www.someurl.com/folder1/file-name-3.pdf

    On web browser, If I type http://www.someurl.com/folder1/ and hit enter, I see three files (file-name-1.pdf, file-name-2.pdf and file-name-3.pdf) with hyperlinks on webpage. How do I restrict directory level view on webpage ? I use VS2008 on DiscountASP.NET.
     
  2. martino

    martino DiscountASP.NET Staff

    You have to disable it through IIS Manager to connect to your site.

    Read our knowledge base article: How to connect to the server using the Microsoft IIS Manager

    Once connected.

    Double click on Directory Browsing icon.

    Click on Disable under the Actions panel on the right.

    That's all you need to do to disable directory browsing.
     
  3. Thanks a lot for the help. I installed INet Manager 1.0 (inetmgr_amd64_en-US). When I'm connecting the server, I tried alternative address without http:// (username.******.net), ID and Password gave as control panel ID (primary account, should have access to IIS) and PWD, however I could not connect. However under IIS Tools - Directory Browsing, I could able to make the change : "Current Directory Browser Setting". I guess I fixed it, with standard error message : If I can change the error to soft message that would be great, or it's alright as well. I can explore on why I can not connect to the server via INet Manager. Thanks for the help.

    HTTP Error 403.14 - Forbidden
    The Web server is configured to not list the contents of this directory.
     
  4. martino

    martino DiscountASP.NET Staff

    That's the error the person should get when directory browsing is been disabled. It protects your list from being viewed via the web browser.
     

Share This Page