-5

My website http://ppyazi.com is currently getting spammed. I can not block the IP address in cpanel. I am wondering if there is any way to block the IP address with php or the htaccess.

This is the ip:

122.106.xxx.xxx
Parsa Yazdani
  • 164
  • 1
  • 11

1 Answers1

3

If you are running apache and are on shared hosting (no access to firewall on the server), then I would opt for htaccess. This would go in a file named .htaccess in your web directory:

Order Deny,Allow
Deny from 10.10.10.10
Deny from 20.20.20.20

Obviously use the IP addresses you want to block instead of these example ones and use a line for each IP

C Miller
  • 428
  • 2
  • 12