how to protect WordPress with Htaccess

Beyond the use of security plugins to enhance security  on joomla website, there are other ways that you can do to protect your wordpress from hackers, namely through the file. htaccess. In this tutorial will explain a few lines of script that can be put on. Htaccess wordpress and an explanation of the function of the script. You do not need to include all the scripts contained posted in this article, just enter what you think is necessary.

By default , wordpress already have a setting. htaccess as follows:

# BEGIN WordPress <IfModule Mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^ index \. Php $ - [L] RewriteCond% {REQUEST_FILENAME}!-F RewriteCond% {REQUEST_FILENAME}!-D RewriteRule. / Index.php [L] </ IfModule> # END WordPress

Later, you can enter additional codes after sentence # END WordPress . Thus, it will ensure you do not damage the setting. Htaccess that has been there before. To be safe, back up the file. Htaccess before editing.

Protect the wp-config.php file

wp-config.php file is critical in a wordpress website, which regulate functions such as setting the wordpress database name and password database is very dangerous if it is known by a hacker. On file. Htaccess, add the following line:

<Files Wp-config.php> order allow, deny deny from all </ Files>

Wp-admin access is only allowed through the IP address you just

With the following setting, you can limit the IP Address of any kind are permitted to access your wp-admin page. Especially for this script, place. Htaccess her apart into the wp-admin folder.

As a side note, do not make this setting if you connect from IP Dynamis.

order deny, allow allow from 180.235.21.1 (change with your IP

Block access from a particular IP address

If you know the IP addresses that are trying to destroy your website, you can block it with the following script. Htaccess.

GET <Limit POST> order allow, deny deny from 203.120.9.8 (change the IP Address of the hackers) allow from all </ Limit>

Blocking access to Directory Browsing

Today, WordPress has been known by many people, so many people know the folder structure of the plugin / theme, which can be a loop hole for hackers to ruin your website. Add the following lines to. Htaccess to prevent it.

# Directory browsing Options All-Indexes

Prevent access to the file wp-content folder

In the wp-content folder contained files related images and setting the theme you are using, so it must be added security to ensure visitors can only directly access certain files, such as pictures and videos only.Especially for this script, the. Htaccess must be made separately, and placed in your wp-content folder.

Order deny, allow Deny from all <Files ~ ".(xml|css|jpe?g|png|gif|js)$"> Allow from all </ Files>

Protects direct access to the file. Htaccess

After all the above configuration, you may still fear hackers could damage files. Htaccess also. This script ensures that outsiders would not be able to access the file. Htaccess directly, thus ensuring the confidentiality of the settings.

# Protect the. Htaccess <files .htaccess=""> order allow, deny deny from all </ Files>

Thus tips to protect your wordpress website using. Htaccess.