How to disable directory browsing using .htaccess?

Web Hosting 1 min read Posted on 02 May 2026 Updated on 07 May 2026 17,331 views
How to disable directory browsing using .htaccess?

Disable Directory Browsing Using htaccess - HostCupid

For security purposes, we recommend that you to disable directory browsing on your website so no one can see the files/folders of your website.
You can disable Directory Browsing by adding this line to your .htaccess file.

Options -Indexes


Get Fast & Affordable Hosting in India

Start your website with SSD hosting, free SSL, cPanel, daily backups and 24/7 support from HostCupid.

View Hosting Plans

Also explore: WordPress Hosting | Reseller Hosting | Domain Registration