This post is about to explain the use of .htaccess for protecting any file on your server. Earlier I have explained the use of htaccess file to protect the .htaccess
htaccess file protection
For PHP websites htaccess files handles the most of the stuffs like, redirection, server side caching, server side compression. We can also protect files and folder using this .htaccess file.