security overkill and the wp_config.php file
-
Hello again, I have been searching google for the best way to secure the wp_config.php file. Since I installed wordpress in the root of my acct I can’t “go up a level”, so what’s an old crank to do? Well I found 2 answers but I don’t know which (if either) is best or will even work…so here they are:
Option 1)just move the file out of the public_html directory. So it would go from: ~/home/user/public_html/wp-config.php to ~/home/user/wp-config.php
more info at https://lifehacker.com/5832976/make-wordpress-more-secureThat was the easier way.
Option 2)Create a new folder (call it “secretstuff”) on the same level as the public_html folder.Copy the wp_config.php and .htaccess files to the new directory and rename that config.php to futurama-fan-fic.php that effectively hides the file but wp can’t find it! So, edit the original wp-config.php files in public_html and www directories – you want to replace everything in them with:
<?php
include(‘/home/usr/secretstuff/futurama-fan-fic.php’);
?>
so now the wp_config.php files in public_html and www directories point to the “real wp_config file” that is now called futurama-fan-fic.php and is found in the secretstuff directory.
a much better explaination with pictures is at https://www.groovypost.com/howto/howto/improve-wordpress-securitty-wp-config-php-location/Will either way work ok?
- The topic ‘security overkill and the wp_config.php file’ is closed to new replies.