Knowledge Base

Get Expert Website Hosting

Choose website reliability and expertise with SiteGround!

Home / Website Help / Other / How to prevent directory listing?

How to prevent directory listing?

Last update: Feb 06, 2020

By default, if you don’t have an index file in a web accessible folder when accessed through a browser, its contents will be listed.

To secure additionally SiteGround shared servers were patched to disallow directory listing out of the box.

To prevent the listing of the folder’s contents on your server, add the following line to the .htaccess file in the folder (if there is no .htaccess file, you can create a new one):

Options -Indexes

 

Share this article