Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my server (over which I have little control), directories are listed by default, so for mysite.com/images I get:

Index of /images

Parent Directory

etc. Is putting an index.html in that directory enough to prevent people listing the files, or is there still a way of getting at that list? Is it the same for my web root directory (mysite.com)?

share|improve this question
up vote 4 down vote accepted

Putting an index.html file should solve that problem. But if you really want to be sure no one gets the directory list just place an .htaccess file in the root of your www directory with this line in it:

Options -Indexes

That will prevent Apache from listing the files of your directories.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.