Revision 248 is a pre-publication revision. (Viewing current revision instead.)

Secure WordPress Config File With htaccess

Your wp-config.php file stores all of your config variables for your WordPress site. If someone has access to this file they will be able to see your database username and password. When you first install WordPress there is a default wp-config-sample.php file which you need to rename and modify. To keep this secure you can move this file outside of the WordPress root folder, WordPress is able to find this file one level up from the root. Another way to secure the wp-config.php file is to use htaccess to deny access for everyone trying to access it. To use htaccess to deny access, add the following snippet in your htaccess file. [php] <Files wp-config.php> Order Allow,Deny Deny from all </Files> [/php]

Revisions

  • August 10, 2012 @ 07:41:56 [Current Revision] by PeterLugg
  • August 10, 2012 @ 07:40:52 by PeterLugg

Revision Differences

August 10, 2012 @ 07:40:52Current Revision
Content
 Added: Your wp-config.php file stores all of your config variables for your WordPress site. If someone has access to this file they will be able to see your database username and password.
 Added: When you first install WordPress there is a default wp-config-sample.php file which you need to rename and modify.
 Added: To keep this secure you can move this file outside of the WordPress root folder, WordPress is able to find this file one level up from the root.
 Added: Another way to secure the wp-config.php file is to use htaccess to deny access for everyone trying to access it. To use htaccess to deny access, add the following snippet in your htaccess file.
Deleted: Added: [php]
 Added: &lt;Files wp-config.php&gt;
 Added: Order Allow,Deny
 Added: Deny from all
 Added: &lt;/Files&gt;
 Added: [/php]

Note: Spaces may be added to comparison text to allow better line wrapping.

Tags: , ,

No comments yet.

Leave a Reply