As you know wp-config.php file store our database name, database username, database password and some settings…
…and if the hacker gets access to the wp-config.php file, It can be very dangerous for our website.
So if you want to secure your website by protecting wp-config.php access with .htaccess?
Then you land at the right place.
Just follow the below steps:
Protect the WordPress wp-config.php file.
Open .htaccess file and copy the below code and paste it into your .htaccess file.
Code to Protect wp-config.php file.
After copy and paste, just save the file and view the result by trying to access the wp-config.php file.
Hope this guide helped you to secure your website.
Don’t forget to share this Prevent Access to wp-config.php file guide.