A knowledge base for new webmasters
How to prevent users from viewing your .htaccess files
Preventing visitors from being able to view the contents of your .htaccess files can add another layer of security to your website. Some web servers are already configured to block access to .htaccess files. If yours isn't, add the four lines below to all of the .htaccess files on your server:
<Files .htaccess> order allow,deny deny from all </Files>
Visitors will now get a "403 Forbidden" error whenever they try to look inside a .htaccess file.