How do I block direct access to critical files using .htaccess?


1.    Make a backup copy of your .htaccess file. Use your backup file to recover if the following fails.

 Be sure to delete the backup file once you are finished.


2.    Add the following to your .htaccess file. This example will protect both the

# configurtation.php and .htaccess files.
<Files .htaccess>
order allow,deny
deny from all
</Files>
<FilesMatch "configuration.php">
Order allow,deny
Deny from all
</FilesMatch>

Category: General Articles
May 25, 2012
FacebookMySpaceTwitterDiggDeliciousStumbleuponLinkedin