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.
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:
Options +Indexes IndexOptions -FancyIndexing
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:
Options +Indexes IndexOptions +FancyIndexing
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.