Disable Directory Browsing with htaccess

When we create a new directory for our website without index.html then visitors get directory listing of all files of that folder.  Have ever noticed on any website that directory listing displaying instead of html file. In absence of index page in a folder , by default directory listing is shown. Directory browsing is very dangerous because malicious visitors can get working functionality of your website.

Disable Directory Browsing with htaccess

This article will help you to disable directory browsing or listing easily on server.

First of all open .htaccess file if exists, if not then create it.

Add given below line.

Options -Indexes

Save . htaccess file.

Now your directory listing is disabled successfully. If you have any questions regarding this article, feel free to comment.

Leave a Reply

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