- 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.
- 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>
You can also protect a lot of file extensions in one single rule. Exemple (the file names between ' ( ' and ' ) ' in this rule are the file extensions to protect ):
<FilesMatch "\.(htaccess|htpasswd|ini|phps|log|sh|conf)$"> Order allow,deny Deny from all </FilesMatch>
Posted in: Joomla