Domanda

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?

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top