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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top