How to prevent directory listing?

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.

In order to secure additionally SiteGround shared servers, they were patched to disallow directory listing out of the box.

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

 

You find this article useful? Click here to learn more about SiteGround web hosting experts and what else we can do for you!