Nate
Nate

Reputation: 28424

Blank index.php vs. Options -Indexes to disallow directory listings?

It seems like it would be a good idea to completely stop people from being able to view directory listings (to improve security and protect content) and from the reading I've done I've found two ways to do it:

Way #1: Put a blank index.php/index.html file in each directory
Way #2: Put the line Options -Indexes in a .htaccess file in each directory

Which one of those is preferable? Or, is there a better way?

Upvotes: 1

Views: 847

Answers (1)

mcalex
mcalex

Reputation: 6798

Use Options -Indexes (at root, not directory level) when you don't want any directory listings exposed.

Use the blank index.html when some directories are ok to list, but some are to be kept private

Upvotes: 4

Related Questions