frequently ask ? : Computers : Internet : Web Servers : Apache

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

43 of 46 people (93%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

I am hosting my website at an ISP using Apache. How can I block the listing of directory content?

Oct 31st, 2001 23:28
Neil Hamilton, Jad Bite, http://httpd.apache.org/docs/mod/core.html#options


Two methods:
1. If your ISP has enabled Indexes in the AllowOverride settings for 
the server in question, you can do this by creating a .htaccess file in 
the root of the directory concerned, containing the following line:
Options -Indexes
This will preserve all the other settings the ISP has set for your 
site, but disallow directory indexes. See 
http://httpd.apache.org/docs/mod/core.html#options for more details
2. If method one doesn't work, there's always the quick and dirty fix 
of putting an index.html file in the directory concerned. It doesn't 
have to contain any data, but it will stop people seeing a listing of 
your directory.