.htaccess: How to disable directory listing?

How to disable directory listing using .htaccess? The webserver (Apache) should allow downloading files in a directory and child directories of it but forbid listing of the directory and child directories.

In the directory that you want to disable directory listing, create the .htaccess file that contains:

Options -Indexes

You can also done by

Options -Indexes


IndexIgnore *

Reference: visit here

Leave a Reply

Your email address will not be published. Required fields are marked *