Displaying Directory Contents In A CS Webpage

In some cases, you might want the CS webserver to display the contents of a directory (located under your public_html directory) when people view that directory in their web browser. This won't work automatically because we have disabled directory indexes to prevent people from accidentally disclosing files without intending to do so.

You can still display the contents of a directory using one of the two following methods:

Method 1: Use an index.html File

You can create an index.html file that contains links to the contents of the directory.

Method 2: Use a .htaccess File

You can add a .htaccess file (don't forget the leading dot) to the directory with the following contents:

Options +Indexes

Make sure your .htaccess file has 604 permissions, just like all other CS webpages need. If in doubt:

chmod 604 .htaccess

The settings in a .htaccess file apply to the directory it is in and to any of its subdirectories (recursively).