Ban users from your website using the .htaccess file

User IP Ban

Valid entries:
IP-addresses should have this format:
xxx.xxx.xxx.xxx

where “xxx” is a number between 0 and 255. In the .htaccess files you can specify a certain IP from your site, but you can also block full ranges.
Examples:
42.13.6.32
Block the specific IP address

212.172.49.
Blocks all IP’s from the range:

212.172.49.xxx
69.241.
Blocks all IP’s from the range:

69.241.xxx.xxx
81.143.4
Blocks all IP’s from the range:

81.143.4xx.xxx.xxx
To actually set the User IP Ban, put this code in your .htaccess file of your server (or create one of your own):

## USER IP BANNING

order allow,deny
#deny from 218.3.89.115
# deny from 222.184.47 dis allow ip from 222.184.47.0 to 222.184.47.255
allow from all