Steps to Modify Apache Directory Listing Style

If someone accesses a directory with no index file (index.html, index.php, index.htm, etc.) on your hosting account that user can either see the files’ list in this directory, or a forbidden message. This doesn’t enable them to access the contents of the directory. You’ll be able to allow/deny the permissions for displaying the folder content. Just in case you show the contents, you’ll be able to configure the type of data that may seem on the page.

Generally, the folder indexing is disabled on our servers for increased the security of our customer’s accounts.

Standard Indexing

With the standard indexing, only the file names are displayed when anyone accesses the folder with none alternative information for the files in that location. For using this type of indexing, add the below lines in a file named .htaccess within the desired folder:

Options +Indexes
IndexOptions -FancyIndexing

Fancy Indexing

With fancy indexing, the files and extra information is displayed about them like the date the file is last modified, its size and description. For using this type of indexing, add the below 2 lines in .htaccess into the destination folder:

Options +Indexes
IndexOptions +FancyIndexing

No Indexing

In case, you don’t need a folder without an index file on your account to show the list of files located inside it, you’ll be able to disable the indexing functionality. For this, you need to add the below line within the .htaccess into the desired directory:

Options -Indexes

So, if anyone accesses the folder in their browser, they’re going to receive a 403 Forbidden message.

Thus in this way, you can modify the Apache directory listing style.