Blocking
There may be times where you want to refuse access to certain robots or human visitors to your web site, in an .htaccess file place the following:
order allow,deny
deny from 127.0.0.1
allow from all
To block multiple IP addresses, list them one per line.
# USER IP BANNING
<Limit GET POST>
order allow,deny
deny from 42.22.5.34
deny from 193.410.145.185
deny from 212.183.53.
deny from 69.222.
allow from all
</Limit>
You can also block an entire IP block/range. Here we will not specify the last octet in the .htaccess file.
deny from 127.0.0
This will refuse access for any user with an address in the 127.0.0.0 to 127.0.0.255 range.
Instead of using numeric addresses, domain names (and subdomain names) can be used to ban users.
deny from isp_name.com
It bans users with a remote hostname ending in isp_name.com. This would stop all users connected to the internet via isp_name.com from viewing your site.
Using .htaccess to block an entire range or name is likely to lock out innocent users. Use with caution.