htaccess block IP

01.Jul.2010

If you have a need to block person or a bot on your website, there is an easy way to do this using htaccess.

1
2
3
4
order allow,deny
deny from 4.4.4.4
deny from 22.22.22.22
allow from all

After deny from, you will add IP address that you want to block. You can add unlimited number of rows with IP addresses that you want to block.