How to Prevent Directory Browsing?

I noticed that when I look at a directory on my site in the browser, and there isn’t an index.html in it, I can browse the contents of the entire directory. For example, if I type, I can see everything in /stuff

Is there any place where I can change this behavior, so a user can’t see everything in /stuff unless they knew the name of a page there? Sometimes, I don’t have any reason to put an index.html file in every folder.


I’m behind a firewall right now and can’t view this page, but it claims to have the answer:

It’s matter of putting an Options directive in your .htaccess file. If you do this at the root level of your domain (inside the folder), it will prevent directory browsing in all of your directories.

Thanks for finding that article. I will try this when I am at home.

That did the trick. Thank you.