How to Protect wp-config.php file in WordPress with .htaccess

If you know about the Wp-config.php file then I’m sure you know that how much important it is.
And for those who don’t know, In wordpress wp-config.php is the file which holds all critical information about database, including username, password, host and database name.
So make yourself safe from hackers by protecting it by using the .htaccess file.

Simply add the following lines in the .htaccess file

<Files wp-config.php>

order allow,deny

deny from all


Facebook Comments

Leave a Reply