[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to disable directory listing like htpaccess in asp.net ?

Posted on 2011-10-17
3
Medium Priority
?
724 Views
Last Modified: 2012-05-12
i like to implement the same as below in asp.net application
is it possible by this way ?
http://blog.eukhost.com/webhosting/enabledisable-directory-listings-using-htaccess/
author said like this ..
"By default when accessing any directory which does not contain an index file (ex: http://yourdomain.com/images/) a directory listing will be shown displaying a list of the files in that folder. Simply adding a blank/ 0 byte text file named “index.html” will prevent this directory list from being displayed" But it doesnot work

if i have index.htm  in a folder of application and then  opened the directory listing on the browser it stills displays the listing and not showing the index.htm page ?

what is alternate solution for .htaccess in asp.net application?

or is this the only way
Using IIS manager right click on the folder that you want to disable browsing , and then uncheck "Directory Browsing" option

Any other way we can implement it by either using .htaccess approach or using vb/C# coding?
0
Comment
Question by:Rajar Ahmed
3 Comments
 
LVL 14

Assisted Solution

by:Daniel Junges
Daniel Junges earned 400 total points
ID: 36981929


appcmd set config /section:directoryBrowse /enabled:true|false

see: http://technet.microsoft.com/en-us/library/cc731109(WS.10).aspx
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 1600 total points
ID: 36984964
Did you see this in the link above?

By default, directory browsing is disabled in IIS so that users cannot see the contents of directories.

If index.htm does not work, use a default.aspx as its an asp.net site.
0
 
LVL 3

Expert Comment

by:ExpertLogin_890
ID: 36985308
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question