Block Visitors From Viewing Directory Indexes

By .     What do you think of this article?

Adding blank index.htm files to all your website directories in effort to keep nosy visitors from viewing all the files in a directory is an annoying chore. You have to check each directory and upload an extra file per directory, so you end up wasting time. Fortunately, there is an easy, 1-shot deal if you create a .htaccess file in your website’s root directory. Add the following line to the .htaccess file:
Options -Indexes

A user who opens a directory that doesn’t already have an index file will get a 403 Permission Denied message instead of viewing an index of all your files.

Posted in: Web Development



is the site owner of Computer Tech Tips and is passionate about computer technology, particularly Windows-based software, malware removal, and web development. He enjoys helping people troubleshoot computer problems and providing technical support to family, friends, and people around the net. Xps wrote 78 article(s) for Computer Tech Tips.


 Subscribe to comments: this article | all articles
Comments are automatically closed after a period of time to prevent SPAM.