My site is showing a list of all my files! How do I control directory indexes?

Question:

My site is showing a listing of all my files. Anyone who comes to my website can see everything! Help!

Answer:

The directory index is showing because you have no index.html file. Anytime there is no index.html (or index.php, index.htm, etc.) the server will show the default index that it creates on the fly.

You can also control the automatic creation of indexes by performing the following steps :

Create (or edit your existing) .htaccess file and put it in the topmost directory that you want to control. To enable / disable for your whole site, put it in your www directory.

To disable directory listings, add the line :

Options -Indexes

To enable them, add the line :

Options +Indexes

If your site still does not list the directory after enabling and you get the error :

“Forbidden You don’t have permission to access / on this server.”

make sure the read privilege is set for the directory you have the .htaccess file in.

My Site is currently displaying a 403 “Forbidden” message. What does this mean?

This could mean several things:

1. You have mistakenly locked yourself out of your account when changing permissions on your account. To fix this, make sure you have your main directory and www directory marked as “executable” (chmod +x). If you are having problems correcting this, you can also contact support to get your account “unlocked”.

2. Your account has been disabled by us either due to abuse (hacked account, script, etc.) or because your account was causing problems for other users on the server (too much CPU usage, etc.). You should generally receive notice on something like this, however in extreme situations (server crashing, etc.) we may have to disable your site without notice. Please contact support and we will work with you to resolve the problem and get your site back online ASAP.

Please put “403 Forbidden” in the subject line of your help desk request.