How to restrict directory listing using .htaccess

Add these 2 lines in your .htaccess file. Create if already not exisit in your server and put in root level.
You don’t have to restart Apache server.

 
IndexIgnore *
Options -Indexes
Share

Leave a Reply

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