Hard Hat Hosting - "Virtual Dedicated Server" web hosting

How can I prevent Directory Listing?

Original URL: http://help.hardhathosting.com/question.php/83

Create an .htaccess file in your main directory (/var/www/html) or a subdirectory of your choice.  This file will control settings for the directory it is placed in , plus all subdirectories below it unless they have .htaccess files of their own.

Add this line to that file:

Options -Indexes
Here are some additional resources:
http://httpd.apache.org/docs/2.0/howto/htaccess.html [Link: http://httpd.apache.org/docs/2.0/howto/htaccess.html]
http://javascriptkit.com/howto/htaccess11.shtml [Link: http://javascriptkit.com/howto/htaccess11.shtml]

Back to original article