Fri, 17 May 2024


How to disable the listing of a directory content using a .htaccess file?

By: Anton, NetArt Media
Wed, 30 September 2020

To disable the directories listing on your website is an important step if you would like to make your website more secure and less vulnerable to hacker attacks. Allowing the users to list the content of your folders and files in them, could help malicious users to obtain important information about your server side script and other files and use them after to attach your website.

To disable the folders content browsing on an Apache server, you could simply use a .htaccess file and insert the following line in it:

Options -Indexes

If you already have a .htaccess file on your website with some other content in it, you could insert this line at the top of the file (to avoid possible conflicts with other .htaccess directives).


Category: Other
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox