Frage

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?

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top