How to block an IP address in .htaccess

October 26, 2018

If you have a specific IP address that you want to block access to, you can do this in Apache's .htaccess with the following code

Deny from x.x.x.x

(replace x.x.x.x with the actual IP address)