Forum Moderators: DixonJones

Message Too Old, No Replies

Blocking One Country by IP

Using .htaccess

         

Agitprop

10:56 pm on Oct 20, 2003 (gmt 0)

10+ Year Member



Our generic one-two-three word domain has received a cease and desist letter from a trademark holder's agent which we intent to vigourously defend. As a preemptive measure would like to permanently block that country, which we do not sell to, from accessing our domain. A look up of country based IPs located here [apnic.net...] revealed the following:

IPv4 Range CIDR

203.0.10.0-203.0.10.255 203.0.10/24 
203.0.32.0-203.0.63.255 203.0.32/19
203.0.84.0-203.0.84.255 203.0.84/24
203.0.97.0-203.0.97.255 203.0.97/24
203.0.121.0-203.0.121.255 203.0.121/24

...

Our server is Apache *nix based on a virtual name-based server (bargain basement).

What would be the best method of blocking this long list of IP using .htaccess?

Any pointers to existing solutions or threads would be much appreciated.

jdMorgan

1:14 am on Oct 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Agitprop,

You can get the method for blocking by classes or by CIDR directly from the examples in the Apache mod_access [httpd.apache.org] documentation.

Jim

Agitprop

1:51 am on Oct 21, 2003 (gmt 0)

10+ Year Member



jdMorgan,

Many thanks for the qiuck pointer to exactly what I needed to expunge this country from accessing our site!