Useful .htaccess Tricks for WordPress

Useful .htaccess Tricks for WordPress

PHP Developers and WordPress developers some times comes across .htacess file.
this file is configuration file for for security and performance. here i will show few usefull tricks to do with .htacess file. This file is located at root of your website (/public_html/)

Before we start lets grab the .htacess file from FTP and keep one backup (Just for fail safe).
if you dont have any .htacess file in your root folder under public_html.

Protect

  1. Protect wp-config.php file
    1. It was most important to protect your wp-config file because it has all the information about your database. if anyone get this file they can easily connect to our data base. Here  is the code for protecting wp-config.php file
      <files wp-config.php>
      order allow,deny
      deny from all
      </files>
    2.  Protect wp-admin folder
      you can easly genarate login protect for wp-admin folder here is the link how to do it
      http://www.htaccesstools.com/htpasswd-generator/