How to modify Apache directory listing style?

When someone accesses a directory with no index file (index.html, index.php, index.htm, etc) on your hosting account that person will either see a list of the files in that directory or a forbidden message, denying them access to the contents of the directory. You can configure whether the folder contents should be shown and if yes – what information appears on the page.

By default, the folder indexing is disabled to improve the security of our customer’s accounts.

Standard Indexing

The standard indexing shows only the file names when the folder is accessed without any other information for the files in that location. To use that type of indexing, add the following lines in a file named .htaccess in the desired folder:

Options +Indexes
IndexOptions -FancyIndexing

Fancy Indexing

Fancy indexing shows the files plus additional information about them like the date the file is last modified, their size and description. To use that type of indexing, add the following two lines in a file named .htaccess in the destination folder:

Options +Indexes
IndexOptions +FancyIndexing

No indexing

If you do not want a folder without an index file on your account to show a list of the files located inside it, then disable the indexing functionality. To do that, add the following line in a file named .htaccess in the desired directory:

Options -Indexes

This way if someone accesses the folder in their browser, they will receive a 403 Forbidden message.

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.