How to Protect wp-config.php with .htaccess Posted in Wordpress Security How to Protect wp-config.php with .htaccess NewWPTricks.com April 21, 2014 Leave a Comment on How to Protect wp-config.php with .htaccess Adding below snippet into your .htaccess file will prevent access to your wp-config.php file: <Files wp-config.php> Order Allow,Deny Deny from all </Files>