Prevent Directory Access

There are a few ways to prevent access to sub-directories of your website.

Blank index

Create an empty file with name index.html or index.php in that directory. Visitors trying to access that directory will see a browser with nothing.

With .htaccess

Create .htaccess in that subdirectory with just one line:

deny from all

Leave a Reply

Your email address will not be published. Required fields are marked *