View Full Version : Eliminate Directory Listings with Apache

09-23-2007, 11:47 AM

Does anyone know how to prevent users from seeing a file list of a directory that doesnt have a index file in it? Im using apache 2.


09-23-2007, 12:21 PM
create a .htaccess file and place it in the root directory of your website...so that all sub-directories would inherit this functionality.

add the following line (inside .htaccess file) to prevent directory listings of all files and dirs.

IndexIgnore *

Or, you can turn directory listing off all together by adding this line

Options -Indexes


09-23-2007, 12:36 PM
thank you

09-23-2007, 04:49 PM
Also if you actually have control over the server and wish for directory listings to be disabled all the time, you can use the Options directive where you declared the site in your apache configuration file.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum