How to Modify Apache Directory Listing Style

November 11, 2022 / Web Development

In this article, you will learn how to modify the Apache directory Listing style. On your hosting account, if a directory does not have an index file (index.html, index.php, index.htm, etc.), the user will either see a list of the files in that directory or receive a banned warning. They are unable to access the directory’s contents as a result. The permission to display the contents of the folder can be granted or denied. You can specify the kind of information that will appear on the page if the contents are displayed.

Important note: On our servers, folder indexing is often disabled for better account security for our customers.

  1. Standard Indexing: When a folder is accessed using the usual indexing, only the file names are visible and no other details about the contents are stored within. Add the lines below to a file called “.htaccess” in the desired folder to use this type of indexing:
    Options +Indexes
    IndexOptions -FancyIndexing
  2. Fancy Indexing: Using fancy indexing, the files and related information, such as the size, description, and latest changed date of each file, are presented. Add the following two lines to the “.htaccess” file in the destination folder to use this type of indexing:
    Options +Indexes
    IndexOptions +FancyIndexing
  3. No Indexing: You can stop the indexing functionality if you don’t want a folder on your account without an index file to show a list of the files contained inside it. You must do this by adding the following line to the “.htaccess” file in the necessary directory:
    Options –Indexes
    Therefore, a 403 Forbidden notice will appear when someone opens the folder in their browser.

You can change the Apache directory listing style in this manner. For more such informative KBs, visit our KB section regularly. And, also don’t forget to check our latest web hosting plans.

 

Dominos Search