How to stop site directory listing

If you create a folder in your site then don’t forget to put “index.html” file there, otherwise site visitor can see complete directory listing of all files and folders of that folder.

How to prevent

In .htaccess file in your site root directory , add the following line.

Options -Indexes

It will prevent visitors from directory listing of folders.