Disable Viewing File

Using .htaccess, you can disable access to any file you like by using the following code:

<files myfile.html>
order allow,deny
deny from all
</files>

You can replace “myfile.html” with the filename you want to protect. This way, if you have a file residing on your server that you aren’t using and don’t want any visitors or search engine spiders to find it, you can protect it using htaccess.