Forum Moderators: DixonJones

Message Too Old, No Replies

Block IP Range in .htaccess

Can this be done?

         

soquinn

6:04 pm on Mar 2, 2004 (gmt 0)

10+ Year Member



Can you block an IP range for a host/isp if you know their range like:

***.***.232.0 - ***.***.243.151

*** = (same numbers)

bull

6:18 pm on Mar 2, 2004 (gmt 0)

10+ Year Member



RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^aaa\.bbb\.(23[2-9]¦24[0-2])\. [OR]
RewriteCond %{REMOTE_ADDR} ^aaa\.bbb\.243\.([0-9]¦[1-9][0-9]¦1[0-4][0-9]¦15[0-1])$
RewriteRule .* - [F]

where aaa and bbb are the first respectively second '***' from your range. Be sure to replace the broken pipe characters ¦ with the real ones from your keyboard.