Secure your wordpress website from hackers

You may have been working on a website, or reading an article about web development, and heard about the .htaccess file, but wondered what it was, or what, if anything, you can do with it.

This tutorial will tell you the basics about .htaccess, and show you a few ways to secure your wordpress website from hackers


1. Blacklist undesired users and bots ip address

2.- Redirect visitors to a maintenance page

3.- Redirect www to non www or vice versa

4.- Force Caching with htaccess

The following htaccess code won’t help the initial page load, but it will significantly help subsequent page loads by sending 304 statuses when requested elements haven’t been modified.

5.- Allow only your IP address on the wp-admin directory

Allow only your IP address to access administrator area of your website. This will help you from hackers to hack your website. Copy paste code in your .htaccess file and upload it to root directory of website.

6.- The easiest way to ban a WordPress spammer

7.- Deny access to your wp-config.php file

8.- Enable gzip to speed-up your wordpress website

Is your website taking more time to load, if yes, copy paste below code in your .htaccess file. Below code will enable gzip compression for your website, which will reduce web page loading time.

9- Redirect Old domain to New domain

If you want to redirect your old domain to new domain, then create .htaccess file on root of your website and copy paste below code.

10- GZip compression

Please don’t forget to share and subscribe to latest updates of the blog. Comments and feedbacks are always welcome! Thanks!

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Article Tags: , , , ,