Forum Moderators: phranque

Message Too Old, No Replies

how to block IP range on .htaccess?

The Chinese spam bot disaster

         

tito

4:20 pm on Jan 20, 2004 (gmt 0)

10+ Year Member



hello, please i'm a newbie dealing with my htaccess, could somebody please help me in blocking the following IP ranges?

211.99.210.0 - 211.99.217.255
211.99.32.0 - 211.99.39.255
218.62.128.0 - 218.63.255.255
61.152.210.0 - 61.152.210.255
219.128.0.0 - 219.137.255.255

these IP ranges are used by Chinese spam bot, email harvesters.

thanks in advance

Agitprop

10:30 pm on Jan 20, 2004 (gmt 0)

10+ Year Member



RewriteEngine on

#deny specified IP range and ban anonymous/open proxy requests
RewriteCond %{HTTP_FORWARDED} !^$ [OR]
RewriteCond %{HTTP:X-Forwarded} !^$ [OR]
RewriteCond %{HTTP:Forwarded-For} !^$ [OR]
RewriteCond %{HTTP:X-Forwarded-For} !^$ [OR]
RewriteCond %{REMOTE_ADDR} ^211\.99\.(21[0-7])\. [OR]
RewriteCond %{REMOTE_ADDR} ^211\.99\.(3[2-9])\. [OR]
RewriteCond %{REMOTE_ADDR} ^218\.(6[23])\. [OR]
RewriteCond %{REMOTE_ADDR} ^61\.152\.210\. [OR]
RewriteCond %{REMOTE_ADDR} ^219\.(12[89]¦13[0-7])\.
RewriteRule .* - [F]

[edited by: jdMorgan at 12:21 am (utc) on Jan. 21, 2004]
[edit reason] Fixed missing space errors caused by posting [/edit]

tito

11:23 pm on Jan 20, 2004 (gmt 0)

10+ Year Member



thanks a lot Agitprop

tito

11:54 pm on Jan 20, 2004 (gmt 0)

10+ Year Member



Agitprop, please i've added your suggestion to my htaccess but i get internal server error.

you can see my htaccess (without your code)on this thread: [webmasterworld.com...]

thanks