Tips & Tricks
A quick .htaccess trick to protect your wp-config.php file
Asked by Sandeep Maurya
September 21, 2025
Here's a simple but effective tip: add this code to the top of your .htaccess file to block web access to your wp-config.php file, one of the most critical files in WordPress. `<files wp-config.php>order allow,deny
deny from all</files>`
deny from all</files>`
1 Answer(s)
Community Support
Sep 21, 2025 at 11:15 AM
This is an excellent and highly recommended security tip, Sandeep! Thanks for sharing with the community.
Your Answer
Please log in to post an answer.