Hide your wp-config.php file

If you are running a WordPress blog or website, take notice — I have a few friends who have told me about having their websites hacked.   Keeping your WordPress version updated, as well as paying attention to what plugins you install can go a long way.  However, this little gem of advice will help keep your blog invisible to some spam searching bots.  Simply add this code to your .htaccess file.  This bit of code will return a 404 for a request to wp-config.php which, hopefully, will confuse spam bots into bypassing your WordPress site.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)wp-config(.*)\.php$ $1wp-config$2\.php [R=404,L]
</IfModule>

Give it a shot!

Leave a Reply