Block an IP address with .htaccess

In case you have identified an unusually high number of requests from a particular IP address with nefarious intentions, we recommend implementing the following code to block that address.

For this example, I will block the IP address. Add this code to the end of your .htaccess file.

<IfModule mod_setenvif.c>
 Order allow,deny
 Allow From All
 Deny from env=DENY

This will ensure that the traffic from that address will no longer be able to reach your server.