Some web hosts (including mine up until recently) allow users to browse files on a particular directory on your website. Although this is handy for you in development to check if files have actually uploaded or whatever else. But of course you don’t want everyone else being able to browse through your files, thankfully there is a short code you can add to your .htaccess files which will block access to browsing these directories.
Add the code to your .htaccess file
To block access to browsing files on directories you can simply add the code below to your .htaccess file:
IndexIgnore *
That’s all! Then if people enter the url of a directory on your website it will no longer list the files in that directory.
Don’t know how to set-up a .htaccess file? Click here




