PDA

View Full Version : How to Disable Directory Browsing on Linux Sites



jakeh
April 1st, 2012, 11:18 AM
To disable Directory Browsing on a Linux (cPanel) server, you'll need to create a .htaccess file in your 'public_html' directory with the following code inside:

Options -Indexes

If your site already has a .htaccess file in the public_html folder, then just add the code to the top line of that file.

postcd
May 12th, 2013, 10:10 AM
You can also add index.html into the folders where you dont want anyone to see its content. Or .htaccess with this line:

deny from all

it will ensure no one will be able to access the folder.

I have this in my htaccess:

RewriteEngine On
Options +FollowSymLinks
Options -Indexes