Knowledge Base
MilesWeb / Web Hosting FAQ

Steps to Modify Apache Directory Listing Style

Approx. read time : 2 min

If someone accesses a directory with no index file (index.html, index.php, index.htm, etc.) on your hosting account that user will either see the files’ list in that directory, or a forbidden message. This doesn’t allow them to access the contents of the directory. You can allow/deny the permissions for displaying the folder content. In case you display the contents, you can also configure the type of information that will appear on the page.

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

Standard Indexing

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

Fancy Indexing

With fancy indexing, the files plus additional information is displayed about them such as the date the file is last modified, its size and description. For using this type of indexing, add the below two lines in .htaccess file in the destination folder:

No Indexing

In case, you don’t want a folder without an index file on your account to display the list of files located inside it, you can disable the indexing functionality. For this, you need to add the below line in the .htaccess file in the required directory:

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

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

Pallavi Godse
Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.