How do I disable directory browsing?

When I access the site I see all the file names. I don't have an index.html file in the directory and don't want to create one in there. What other way can I protect the directory to stop people from viewing all my files?

You can disable the browsing of directories using the control panel, uploading a blank index.html file or by modifying an .htaccess file on a directory.

1) To modify using the control panel: Access your cPanel and click on Index Manager. Next click on the folder you wish to disable the indexing on. The Index Manager will automatically create an .htaccess file for you within that folder.

2) You can also upload just a blank or generic index.html file. The index file is the first file that will show by default when a user accesses a directory. This method will prevent the user from seeing an error.

3) To modify using an .htaccess file: To disable directory browsing using an .htaccess file. Open up a text editor and put the following line in it:
Options -Indexes
Now select Save As... from the menu and select "All files"' in the Save As type before typing a filename. For the filename type ".htaccess" (without quote marks and remember the dot at the start). Upload the file to your public_html directory (or other directories) and the browsing of directories on your account will be disabled.


Reviewed: 11/05/2016

  • Email, SSL
  • 11 Users Found This Useful
Was this answer helpful?

Related Articles

What if I need more hard drive space or bandwidth? - delete

Submitted by user: I need more HD space.. There are a few other companies out there that are...

What language can I program in? Where can I download scripts?

For the most part PHP is the most common scripting on the web. Many other scripts and programs in...

Help - my site's been infected by a Virus

The viruses that attach themselves to web pages are unfortunately common, and though they are...

Fix for FrontPage hit counter on subdomain

Problem: You're using MS Front Page with web bots. The hitcounter works fine on your main domain,...

Can you tranfser files from my old host to you?

If your current web hosting provider has cPanel all you would need to do is create a BACKUP of...