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 pageload, but it will significantly help subsequent pageloads by sending 304 statuses when requested elements haven’t been modified.

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

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

9- Redirect Old domain to New domain using

10- GZip compression

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