How to deny users by IP?
Is there a hacker who tried to hack your site? Do you find some baleful access from a IP block? You just need add below simple codes into your .htaccess file to block the pesky visitors.
deny from 18.104.22.168
deny from 203.113
allow from all
You can deny access based upon IP address or an IP block. The above blocks access to the site from 22.214.171.124, and from any sub domain under the IP block 203.113 (126.96.36.199 to 188.8.131.52). You can also allow or deny by domain name rather than IP address (allow from yahoo.com works for www.yahoo.com or groups.yahoo.com, etc.)