Howto: Disable Directory Listing

How to Disable Directory Listing? You may want to hide directory listings because by default Webservers look for an index file under every directory and if not found, they list the files and directories under it on browsing the directory.

To disable Directory Listing for an account recursively:

1) Create a .htaccess file under the directory

vi .htaccess

2) Add Options directive as follows:

Options -Indexes

3) Save the file.

You now will see a Forbidden message on accessing a directory that do not include an index file.

This entry was posted on Sunday, November 29th, 2009 and is filed under Linux Administration. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.