Wednesday, March 5, 2008

Disable Apache Directory Listings

How to Disable Apache Directory Listings

The following procedure disables directory listings on an Apache web server using a .htaccess rule.

Go to the folder that you wish to disable directory listings on.
>cd /home/user/folder

Open .htaccess and add the following. If .htaccess doesn’t exist, you can create it.

>vi .htaccess

Insert the following line:

Options –Indexes

Save your modifications to the file and quit.

No comments: