How do I prevent file and folder listings when someone accesses my site

Avatar
  • updated
  • Answered

When someone uses my url and then /downloads or example www.mysite/downloads they get a listing of the files in that folder. How can I prevent that? Would making a folder directly under my Home folder work ok for that? I have made a folder called test and it seems to work for my simple attempts. Is this a good way to do this?

Avatar
IMH Support Agent 2
  • Answered

Hello Jamesgun,


Thanks for the question about preventing file or folder listings on your site.  This can be done through the .htaccess file.  Follow this article:  Preventing the Index Of Page in .htaccess. This will prevent the listing of the file and folders in your site.


If you have any further questions or comments, please let us know.

Kindest regards,
Arnel C.