Directory listing

Hi for sure 1000 times asked but the search does not give me an answer.
How can I prevent directory listing for my whole site?
I don´t want to place in each directory an index.html
Thank you in advance

Put the following in your .htaccess file:

Options -Indexes--------
si-blog | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]

Is that recursive to subdirectories?

Yes it is. Unless of-course, you override it with another .htaccess directive in the sub-directory itself.


Web Hosting Reviews | DreamHost Promo Code

Exactly what I was looking for! But… I do not have a .htaccess file, or so it seems. Can I create one? What should be in it?


Yes, just create a file called .htaccess and upload it to the web-directory for your domain. Note, if you are using Windows you might have problems creating a file called .htaccess, if so, just create one called htaccess.txt and rename it after uploading it to your server.

Just the directives you need, in this case a single line of text as follows;

Options -Indexes


Web Hosting Reviews | DreamHost Promo Code

Hi Mark. This doesn’t seem to work. I can upload it fine but can still view the contents of a directory. What am I missing?

This is the output from ssh so you can see the file is in place:

[saltine]$ more .htaccess
Options -Indexes

Have you placed the file in the web-directory for your domain? By default this web-directory will have the same name as the domain (eg:


Web Hosting Reviews | DreamHost Promo Code

this works for me:

IndexIgnore *

Thanks guys, placed it in the wrong dir, it’s OK now.