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

Asked by:
CombChess
Time:
2012-02-29 4:51 pm
Category:
General Server Setup
Hits:
535
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.

You must login before you can ask a follow up question.

You must login before you can submit an answer.

Best answer chosen by User

0

ChristiNi
2012-02-29 5:06 pm
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.

You must login before you can post a comment about this answer.

Like this Question?

Support 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.