Turning Off Directory Browsing in Cpanel Web Host

Turning off directory browsing is one of the most important steps to be carried out immediately in your cpanel web hosting account.

By default the indexes are On.This means that when you type a URL of a folder which does not contain the default file index.php or index.htm or index.html, the contents of the directory are shown to the user . Obviously you do not want the contents of your web folder to be displayed to the user.

Here is how to turn off directory browsing.

Login to your Cpanel account.And locate index manager and open it.

choose-index-manager

Click on the public_html folder in the next screen as we want to turn off directory browsing for all websites i.e everything that will come inside this folder.

choose-folder

Next Click on No Indexing

choose-no-indexing

That is all.From now on any folder which does not contain the default file index.php or index.htm or index.html will show a No Permission message instead of the contents of that folder.

Another Method
Open the .htaccess file in the public_html folder,if not there upload a txt file and rename it to .htaccess.
Add the following code to the file

Options -Indexes


That is all.

If you liked this article please do leave a reply and share it with friends.

Thanks.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.