Prevent viewing a list of files (directory listing) on the server

Asked by:
CombChess / 5 Points
Time:
2012-02-29 8:51 pm EST
Category:
General Server Setup
Hits:
1,097
Hi, I wanted to know how to prevent others from accessing my directories in two situations. Either if I don't have an index.html, or if they visitor knows the directory, for example if my site is: www.mywebsite.com and they type in www.mywebsite.com/images they get a directory listing of all of my images. How do I STOP that from happening. Thank you.

To ask this user for more information, please first login.

To submit an answer, please login.

Best answer chosen by User

0

ChristiNi
Staff
13,688 Points
2012-02-29 9:06 pm EST
Hello CombChess,

Thank you for your question about preventing access to directory listings. The most efficient way to do this is to use the Index Manager in cPanel. Choose "No Indexing" for public_html (your main domain's document root). This adds code to your .htaccess file which will protect not only that folder but subfolders as well (unless you add a separate .htaccess file in a subfolder).

Please let us know if you have any questions or need any additional assistance.

Regards,

Christi N.

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}