Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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
BirdsAreHere.png
CanYouSpot-AdBlank.jpg

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

1 Answer 1

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

 
discard

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.