About Directory Listings
Let’s say you have a directory (folder) called “stuff” inside your public_html directory, and there is no file called index.html inside of stuff. If a person accesses:
http://yoursite.com/stuff/
They’ll see a listing of all the files in the directory “stuff.” They can then view or download files in that directory by clicking links to filenames. This can be convenient, but in some cases, you may want to disable this behavior for a particular directory (and its subdirectories). Here’s how:
- Log into cPanel
- Click “Directory Indexing”
- Navigate to the directory you want to protect by clicking the folder icons.
- Select the directory by clicking its name
- Select “No Indexes” and click Save (there are other options there as well — feel free to experiment)
Users will no longer be able to view directory listings for that directory or its subdirectories.
Note: Turning off directory listings does not secure your files! If someone already knows the filename, they can still access it directly. To truly secure a directory, you’ll want to enable Password Protection on the directory.
Modifying Directory Listings
Advanced users only: Because Birdhouse has the Apache mod_autoindex module installed, it is possible to change the way directory listings are displayed with any of the directives listed here. For example, if you want to display some custom text at the bottom of directory indexes, put that text into a file called README.html and place it in the same directory. Other customizations are possible as well. Contact us for assistance.


