How to block an IP address with .htaccess ?

Recently I have discovered many registered users with strange login names. Well, as you expected that those users were created by Ad-robots sourced from few different locations. I checked stat page to see who is top visitors by IP address and researched where those traffic comes from. I hate hate hate this.

I concluded below IP addresses

My Black Lists

91.121.15.189
91.121.135.128
91.121.211.187
94.23.26.35
91.205.124.13
208.80.194.0/24
:
:

There are couple of way to block those IP addresses, but here we are using .htaccess due to it is easy and I am using hosting service so no firewall or no router access.

 

First of all, this method won’t work if you are using Window based Web server. If you don’t have .htaccess file on www directory of your web server, create one. And edit the file. Here is sample of .htaccess on our server.

order allow,deny
deny from 91.121.15.189
deny from 91.121.135.128
deny from 91.121.211.187
deny from 94.23.26.35
deny from 91.205.124.13
deny from 208.80.194.
allow from all

 

My Black Lists(continued)

92.241.168.0/24
194.165.42.*
84.243.197.*
87.118.124.*
62.141.58.56
194.8.74.*
194.8.75.*
208.118.122.76
212.95.54.41
91.207.4.90
81.24.208.9
77.87.154.222
194.8.74.155

Leave a Reply