This is our another tutorial on .htaccess in order to make your blog more secure. In this tutorial, we will see how to prevent access to .htaccess file. This is one of highly sensitive file, which should not be accessible to anyone else except you. There are two things which you can do to make it inaccessible –
1) Make it inaccessible by adding below piece of code –
# Add this code to your .htaccess file
deny from all
After adding above statements to your file, now the file is safe. Any attempts to access this file would led to 403 error.
2) Change the permissions of the file to 644 as shown below – Login to your cpanel, locate the .htaccess file and change access permissions.