0
Welcome Guest! Login
0 items Join Now

banning countries using htaccess

    • damo's Avatar
    • damo
    • Elite Rocketeer
    • Posts: 2142
    • Thanks: 0

    banning countries using htaccess

    Posted 17 years 4 months ago
    • i'm getting sued by someone who has very deep pockets. they want me to close down one of my websites but they've just let slip that they only really have a problem with my website in south africa

      so, i've heard that the .htaccess file can do this; but how woudl you go about shutting it down for a country?

      enter GollumX or anyone else that can help ...

      cheers as always
      lord damo
    • www.c3p0.se - sweden
    • GollumX's Avatar
    • GollumX
    • Elite Rocketeer
    • Posts: 2817
    • Thanks: 0

    Re: banning countries using htaccess

    Posted 17 years 4 months ago
    • hey damo, stick the following into your .htaccess file:
      <Limit GET HEAD POST>
      order allow,deny
      deny from XXX.XXX.XXX.XXX
      deny from XXX.XXX.XXX.XXX
      deny from XXX.XXX.XXX.XXX
      allow from all
      </LIMIT>

      Note that this is a great way to block a few IP's. However, blocking a whole country with .htaccess could severely affect the performance of your site. At the present time a block of south africa could mean adding over 500 lines to your .htaccess file, which would then be checked on every page view!! :o

      If you still want to proceed, look for the South African IP's at http://software77.net/cgi-bin/ip-country/geo-ip.pl . South Africa country code is ZA.

      You'd probably need to write a script to add "deny from " to each line as doing 500 lines manually would be a huge PITA.


      The better way requires that your host have a GEOIP module and mod_rewrite installed on the server. Email them asking for this. With this you can redirect your visitors from South Africa to a page saying your site is offline ... you can even make a copy of the default windows "site unavailable' page. You can also send them to a page with affiliate or adsense links, or you can send them to my site ;)

      Directions at http://www.affiliatewebsitedesign.com/forum/viewtopic.php?p=5679


      I believe there are also ways to do this with php scripts, but that is beyond my knowledge.

      good luck damo. i'm guessing this is the World Cup site :)
    • Say no to Internet Explorer 6.
      twitter.com/mark_up
    • Matthew's Avatar
    • Matthew
    • Hero Rocketeer
    • Posts: 299
    • Thanks: 0

    Re: banning countries using htaccess

    Posted 17 years 4 months ago
    • Here are the ip ranges in question:
      62.184.8.32 62.184.8.63
      62.184.13.128 62.184.13.159
      62.184.26.208 62.184.26.223
      62.184.57.16 62.184.57.23
      62.184.88.0 62.184.88.63
      62.184.88.160 62.184.88.175
      62.184.89.0 62.184.95.255
      62.184.110.0 62.184.111.255
      62.184.128.64 62.184.128.79
      62.184.173.96 62.184.173.127
      62.184.174.80 62.184.174.95
      62.185.33.96 62.185.33.127
      62.185.52.64 62.185.52.79
      62.185.53.96 62.185.53.127
      62.185.54.192 62.185.54.255
      62.185.66.192 62.185.66.223
      62.185.84.128 62.185.84.255
      62.185.90.168 62.185.90.175
      62.185.90.224 62.185.90.255
      62.185.93.160 62.185.93.175
      62.185.102.224 62.185.102.239
      62.185.102.248 62.185.102.255
      62.185.113.224 62.185.113.239
      62.185.120.192 62.185.120.199
      62.185.120.208 62.185.120.223
      62.185.132.160 62.185.132.191
      62.185.138.32 62.185.138.63
      62.185.147.224 62.185.147.255
      62.185.160.48 62.185.160.79
      62.185.176.0 62.185.176.95
      62.185.177.0 62.185.183.79
      62.185.183.112 62.185.183.127
      62.185.184.0 62.185.188.159
      62.185.189.0 62.185.192.31
      62.185.192.40 62.185.192.63
      62.185.193.64 62.185.193.79
      62.185.194.0 62.185.194.255
      62.185.196.192 62.185.196.223
      62.185.196.240 62.185.196.255
      62.185.224.160 62.185.224.191
      62.185.237.32 62.185.237.63
      62.186.2.160 62.186.2.191
      62.186.10.192 62.186.10.255
      62.186.33.80 62.186.33.95
      62.186.52.32 62.186.52.47
      62.186.67.32 62.186.67.63
      62.186.94.192 62.186.94.255
      62.186.104.64 62.186.104.127
      62.186.106.160 62.186.106.175
      62.186.108.32 62.186.108.47
      62.186.120.32 62.186.120.63
      62.186.120.80 62.186.120.95
      62.186.154.64 62.186.154.127
      62.186.158.0 62.186.159.255
      62.186.170.176 62.186.170.191
      62.186.176.0 62.186.178.191
      62.186.178.224 62.186.180.31
      62.186.180.64 62.186.180.127
      62.186.181.0 62.186.183.31
      62.186.183.64 62.186.186.95
      62.186.187.0 62.186.187.191
      62.186.188.0 62.186.191.255
      62.186.208.72 62.186.208.79
      62.186.222.0 62.186.223.255
      62.186.234.32 62.186.234.63
      62.186.234.128 62.186.234.143
      62.186.234.192 62.186.234.255
      62.187.22.0 62.187.31.255
      62.187.88.0 62.187.88.223
      62.187.89.0 62.187.89.255
      62.187.108.0 62.187.109.255
      62.200.56.0 62.200.56.63
      62.200.56.96 62.200.56.127
      62.200.57.0 62.200.59.255
      62.200.88.0 62.200.88.127
      62.200.88.144 62.200.88.159
      62.200.130.0 62.200.131.255
      62.200.133.0 62.200.133.191
      62.200.134.0 62.200.134.191
      62.200.134.224 62.200.134.247
      62.200.135.0 62.200.135.127
      62.200.160.0 62.200.164.255
      62.200.166.0 62.200.166.95
      62.200.166.128 62.200.166.191
      62.200.178.0 62.200.178.255
      64.245.0.0 64.245.15.255
      80.255.39.168 80.255.39.175
      80.255.51.248 80.255.51.255
      80.255.61.160 80.255.61.191
      82.113.137.208 82.113.137.215
      82.206.128.160 82.206.128.175
      82.206.129.32 82.206.129.47
      82.206.131.0 82.206.131.159
      82.206.135.0 82.206.135.7
      82.206.159.0 82.206.159.127
      82.206.165.128 82.206.166.127
      82.206.180.0 82.206.181.255
      82.206.192.0 82.206.193.255
      82.206.201.128 82.206.201.255
      84.254.128.57 84.254.128.60
      84.254.131.129 84.254.131.168
      84.254.131.192 84.254.131.255
      84.254.147.0 84.254.147.63
      168.210.50.0 168.210.50.255
      192.109.242.0 192.109.242.255
      194.117.112.4 194.117.112.7
      194.117.113.100 194.117.113.103
      194.117.119.111 194.117.119.112
      194.117.120.49 194.117.120.49
      194.117.120.102 194.117.120.102
      194.117.120.112 194.117.120.112
      194.117.120.167 194.117.120.167
      194.117.122.72 194.117.122.72
      194.117.124.73 194.117.124.73
      194.117.124.219 194.117.124.219
      194.194.54.96 194.194.54.127
      194.194.239.128 194.194.239.255
      194.196.46.0 194.196.46.255
      194.196.176.0 194.196.181.255
      194.253.11.144 194.253.11.159
      194.253.43.0 194.253.43.159
      194.253.146.160 194.253.146.191
      194.253.169.0 194.253.169.127
      194.253.169.192 194.253.169.207
      194.253.169.216 194.253.169.223
      194.253.178.0 194.253.178.255
      195.51.69.192 195.51.69.207
      195.51.88.0 195.51.91.95
      195.51.91.128 195.51.91.191
      195.51.131.192 195.51.131.223
      195.51.156.0 195.51.159.255
      195.51.233.152 195.51.233.159
      195.51.245.0 195.51.245.255
      195.75.128.0 195.75.129.255
      195.75.131.0 195.75.131.47
      195.75.131.56 195.75.131.63
      195.75.131.128 195.75.131.223
      195.75.131.240 195.75.132.79
      195.75.132.96 195.75.135.255
      195.75.153.0 195.75.154.103
      195.75.154.112 195.75.154.223
      195.75.155.0 195.75.155.223
      195.75.156.0 195.75.158.255
      195.79.128.0 195.79.129.255
      195.112.161.16 195.112.161.19
      195.112.179.126 195.112.179.126
      195.118.22.0 195.118.23.255
      195.118.27.0 195.118.27.255
      195.118.30.0 195.118.31.255
      195.118.110.192 195.118.110.223
      195.118.201.0 195.118.201.255
      195.118.203.0 195.118.203.255
      195.118.207.0 195.118.207.255
      195.183.11.32 195.183.11.47
      195.183.15.192 195.183.15.207
      195.183.31.224 195.183.31.239
      195.183.33.192 195.183.33.207
      195.183.33.216 195.183.33.223
      195.183.35.96 195.183.35.127
      195.183.41.0 195.183.41.159
      195.183.61.192 195.183.61.255
      195.183.67.128 195.183.67.255
      195.183.69.208 195.183.69.223
      195.183.85.208 195.183.85.223
      195.183.95.96 195.183.95.111
      195.183.102.96 195.183.102.127
      195.183.128.32 195.183.128.63
      195.183.128.96 195.183.129.127
      195.183.130.0 195.183.130.15
      195.183.130.32 195.183.130.127
      195.183.131.0 195.183.131.95
      195.183.132.0 195.183.132.31
      195.183.132.128 195.183.135.255
      195.183.137.0 195.183.137.255
      195.183.147.32 195.183.147.47
      195.183.157.128 195.183.157.143
      195.183.158.192 195.183.158.223
      195.183.160.200 195.183.160.207
      195.183.166.208 195.183.166.223
      195.183.194.0 195.183.196.143
      195.183.197.0 195.183.197.31
      195.183.197.128 195.183.197.255
      195.183.202.0 195.183.203.63
      195.183.203.112 195.183.203.127
      195.183.204.0 195.183.205.255
      195.184.138.192 195.184.138.255
      195.184.157.0 195.184.157.255
      195.213.27.0 195.213.27.31
      195.213.30.128 195.213.30.191
      195.213.49.16 195.213.49.31
      195.213.56.32 195.213.56.63
      195.213.92.192 195.213.92.255
      195.213.93.32 195.213.93.63
      195.213.93.124 195.213.93.127
      195.213.94.64 195.213.94.71
      195.213.103.0 195.213.103.255
      195.213.117.0 195.213.117.127
      195.213.140.64 195.213.140.127
      195.213.146.104 195.213.146.111
      195.213.146.192 195.213.146.223
      195.213.238.0 195.213.238.255
      195.213.252.128 195.213.252.255
      209.159.160.0 209.159.161.255
      209.159.167.0 209.159.169.255
      212.133.48.152 212.133.48.159
      212.137.54.0 212.137.54.255
      213.31.200.240 213.31.200.255
      213.31.207.144 213.31.207.159
      213.31.207.240 213.31.207.247
      213.62.240.0 213.62.241.255
      213.185.113.144 213.185.113.159
      213.185.113.248 213.185.113.255
      213.255.195.168 213.255.195.175
      213.255.211.192 213.255.211.199
      216.0.48.0 216.0.48.255
      216.0.50.0 216.0.50.255
      216.0.52.0 216.0.53.255
      216.2.176.0 216.2.183.255
      216.4.160.0 216.4.163.255
      216.5.0.0 216.5.7.255
      216.5.192.0 216.5.199.255
      216.139.164.16 216.139.164.23
      216.139.164.32 216.139.164.39
      216.139.164.48 216.139.164.71
      216.139.164.80 216.139.164.87
      216.139.164.144 216.139.164.159
      216.139.164.192 216.139.164.215
      216.139.164.232 216.139.164.239
      216.139.169.192 216.139.169.199
      216.139.172.48 216.139.172.55
      216.139.172.80 216.139.172.87
      216.139.172.224 216.139.172.239
      216.139.172.248 216.139.172.255
      216.139.173.144 216.139.173.159
      216.139.176.32 216.139.176.39
      216.139.176.88 216.139.176.103
      216.139.176.120 216.139.176.143
      216.139.176.152 216.139.176.159
      216.139.176.176 216.139.176.183
      216.139.179.64 216.139.179.95
      216.139.185.32 216.139.185.79
      216.250.213.144 216.250.213.159
      216.250.213.224 216.250.213.239
      217.23.111.0 217.23.111.31
      217.77.240.243 217.77.240.243
      217.77.242.214 217.77.242.214

      To the best of my knowledge, you can use Regular Expressions in your .htaccess to specify the ranges, which might reduce the size of your .htaccess somewhat, and might also help with performance, but I still don't envy the task of creating that list, or even creating the script to automate creating that list.

      The method for doing it with PHP would be to grab the IP of the visitor, and perform a whois (many stats modules do this all the time). If the country code is ZA, then they are from South Africa.

      In order to prevent too much strain on the site, my cheapo solution would be to duplicate your template, and have an identical copy for the home page, and the original as the default. Modify the home page template to do the IP check, and redirect or whatever. This way, you will not be doing the checking for every page, so less of a performance hit. Of course, bookmarks into the site would still work, so I don't know if it would appease the party suing you.

      Finally, and this is really a cheapskate idea, but why about amending the site's terms and conditions, and explicitly disallowing access from South Africa? Plenty of sites use this technique to avoid legal troubles from countries where access might be unlawful. I am sure that it would make your opponent very unhappy, because it would have zero practical impact, but it would go a long way towards undercutting their legal grounds for suing you.

      Best of luck, and if you want to pursue the PHP ip lookup option, let me know, I might be able to help.
    • www.gofftech.com Web Design
    • GollumX's Avatar
    • GollumX
    • Elite Rocketeer
    • Posts: 2817
    • Thanks: 0

    Re: banning countries using htaccess

    Posted 17 years 4 months ago
    • LOL i was gonna post the IP's here too but was just too long. I see you've put two on each line though :)
      In order to prevent too much strain on the site, my cheapo solution would be to duplicate your template, and have an identical copy for the home page, and the original as the default. Modify the home page template to do the IP check, and redirect or whatever. This way, you will not be doing the checking for every page, so less of a performance hit. Of course, bookmarks into the site would still work, so I don't know if it would appease the party suing you.

      I read somewhere about writing a script to check for the existence of an existing session. If there is no existing session, then check up on the IP, otherwise, ignore it. Pity I can't remember where... the author provided the checking code.
    • Say no to Internet Explorer 6.
      twitter.com/mark_up
    • Matthew's Avatar
    • Matthew
    • Hero Rocketeer
    • Posts: 299
    • Thanks: 0

    Re: banning countries using htaccess

    Posted 17 years 4 months ago
    • GollumX wrote:
      LOL i was gonna post the IP's here too but was just too long. I see you've put two on each line though :)

      Actually, each of those IP's represents the start and end points of a range, so typing them in one at a time would be thousands of lines. :D
      In order to prevent too much strain on the site, my cheapo solution would be to duplicate your template, and have an identical copy for the home page, and the original as the default. Modify the home page template to do the IP check, and redirect or whatever. This way, you will not be doing the checking for every page, so less of a performance hit. Of course, bookmarks into the site would still work, so I don't know if it would appease the party suing you.

      I read somewhere about writing a script to check for the existence of an existing session. If there is no existing session, then check up on the IP, otherwise, ignore it. Pity I can't remember where... the author provided the checking code.

      I don't know what I was smoking this morning, but the template replication is not needed. A module that is on the first page would suffice. I like the session idea, though, as that makes for a really clean way to get it done.

      The only real flaw that I see with this approach is that proxy services would zip right past such a block. I'm guessing that Damo could care less about actually blocking the site, however, and merely wants his antagonists to take a long walk off a short peer (metaphorically speaking, of course). ;)
    • www.gofftech.com Web Design
    • GollumX's Avatar
    • GollumX
    • Elite Rocketeer
    • Posts: 2817
    • Thanks: 0

    Re: banning countries using htaccess

    Posted 17 years 4 months ago
    • Matthew wrote:
      GollumX wrote:
      LOL i was gonna post the IP's here too but was just too long. I see you've put two on each line though :)

      Actually, each of those IP's represents the start and end points of a range, so typing them in one at a time would be thousands of lines. :D

      Oh ok. I didn't really look hard enough. I assumed you'd just use CIDR blocks.
      # Entire IPV4 Address range for SOUTH AFRICA (ZA)
      # IP's below based on registry information obtained on Jun-29-2007
      # Always make sure your data is fresh -- Update monthly to be sure!!
      # IP's: 10,677,504
      # Distinct CIDR Blocks: 764 (Overlaps removed)
      41.160.0.0/12
      41.192.0.0/14
      41.198.0.0/16
      41.204.192.0/19
      41.206.192.0/19
      41.207.224.0/19
      41.208.0.0/18
      41.208.192.0/18
      41.221.0.0/20
      41.222.32.0/21
      41.222.48.0/21
      41.223.8.0/22
      41.223.32.0/21
      41.223.60.0/22
      41.223.68.0/22
      41.223.112.0/22
      41.223.120.0/22
      41.223.236.0/22
      41.223.244.0/22
      41.223.252.0/22
      41.240.0.0/13
      66.8.0.0/17
      66.18.64.0/19
      69.67.32.0/20
      137.158.0.0/16
      137.214.0.0/15
      139.53.0.0/16
      143.128.0.0/16
      143.160.0.0/16
      146.64.0.0/16
      146.141.0.0/16
      146.182.0.0/16
      146.230.0.0/15
      146.232.0.0/16
      147.110.0.0/16
      152.106.0.0/15
      152.108.0.0/14
      152.112.0.0/16
      155.159.0.0/16
      155.232.0.0/13
      155.240.0.0/16
      156.8.0.0/16
      160.115.0.0/16
      160.116.0.0/15
      160.118.0.0/16
      160.121.0.0/16
      160.122.0.0/15
      160.124.0.0/16
      163.195.0.0/16
      163.196.0.0/14
      163.200.0.0/14
      164.88.0.0/16
      164.146.0.0/15
      164.148.0.0/14
      164.155.0.0/16
      165.3.0.0/16
      165.4.0.0/15
      165.8.0.0/14
      165.25.0.0/16
      165.143.0.0/16
      165.144.0.0/14
      165.148.0.0/15
      165.165.0.0/16
      165.180.0.0/16
      165.233.0.0/16
      166.85.0.0/16
      168.76.0.0/16
      168.80.0.0/15
      168.89.0.0/16
      168.128.0.0/16
      168.142.0.0/16
      168.155.0.0/16
      168.164.0.0/16
      168.172.0.0/16
      168.206.0.0/16
      168.209.0.0/16
      168.210.0.0/16
      169.129.0.0/16
      169.202.0.0/16
      192.33.10.0/24
      192.42.99.0/24
      192.48.253.0/24
      192.70.237.0/24
      192.82.142.0/24
      192.84.244.0/24
      192.94.61.0/24
      192.94.210.0/24
      192.94.240.0/23
      192.94.246.0/24
      192.96.1.0/24
      192.96.2.0/23
      192.96.4.0/22
      192.96.8.0/21
      192.96.16.0/24
      192.96.19.0/24
      192.96.20.0/23
      192.96.22.0/24
      192.96.24.0/21
      192.96.32.0/22
      192.96.38.0/23
      192.96.40.0/24
      192.96.43.0/24
      192.96.45.0/24
      192.96.46.0/23
      192.96.48.0/21
      192.96.56.0/23
      192.96.58.0/24
      192.96.60.0/23
      192.96.68.0/22
      192.96.72.0/24
      192.96.74.0/23
      192.96.76.0/23
      192.96.79.0/24
      192.96.80.0/20
      192.96.96.0/22
      192.96.100.0/23
      192.96.102.0/24
      192.96.104.0/21
      192.96.112.0/20
      192.96.128.0/22
      192.96.132.0/23
      192.96.134.0/24
      192.96.138.0/23
      192.96.140.0/24
      192.96.142.0/24
      192.96.144.0/24
      192.96.146.0/23
      192.96.148.0/22
      192.96.152.0/22
      192.96.158.0/24
      192.96.164.0/22
      192.96.178.0/23
      192.96.180.0/22
      192.96.184.0/21
      192.96.193.0/24
      192.96.194.0/23
      192.96.196.0/22
      192.96.224.0/21
      192.96.232.0/24
      192.96.234.0/23
      192.96.236.0/22
      192.96.240.0/22
      192.96.245.0/24
      192.96.246.0/23
      192.96.248.0/22
      192.96.252.0/23
      192.96.254.0/24
      192.100.1.0/24
      192.102.9.0/24
      192.133.250.0/24
      192.157.190.0/24
      192.189.75.0/24
      192.231.254.0/24
      196.1.0.0/24
      196.1.8.0/21
      196.1.16.0/21
      196.1.24.0/23
      196.1.32.0/20
      196.1.48.0/22
      196.1.56.0/21
      196.1.71.0/24
      196.1.74.0/23
      196.1.76.0/22
      196.1.80.0/21
      196.1.88.0/22
      196.1.101.0/24
      196.1.102.0/23
      196.1.128.0/23
      196.1.144.0/20
      196.2.16.0/20
      196.2.32.0/19
      196.2.64.0/20
      196.2.96.0/19
      196.2.128.0/18
      196.3.57.0/24
      196.3.92.0/23
      196.3.105.0/24
      196.3.107.0/24
      196.3.108.0/24
      196.3.110.0/23
      196.3.112.0/20
      196.3.128.0/22
      196.3.148.0/22
      196.3.154.0/23
      196.3.156.0/22
      196.3.160.0/20
      196.3.176.0/22
      196.3.224.0/19
      196.4.0.0/19
      196.4.32.0/21
      196.4.40.0/22
      196.4.44.0/23
      196.4.71.0/24
      196.4.72.0/21
      196.4.81.0/24
      196.4.82.0/23
      196.4.84.0/22
      196.4.88.0/21
      196.4.96.0/19
      196.4.128.0/18
      196.4.192.0/19
      196.4.224.0/20
      196.4.240.0/21
      196.4.248.0/22
      196.4.252.0/23
      196.4.254.0/24
      196.5.0.0/16
      196.6.1.0/24
      196.6.2.0/23
      196.6.4.0/22
      196.6.8.0/21
      196.6.16.0/20
      196.6.32.0/19
      196.6.64.0/19
      196.6.96.0/22
      196.6.100.0/23
      196.6.102.0/24
      196.6.121.0/24
      196.6.123.0/24
      196.6.124.0/22
      196.6.128.0/19
      196.6.160.0/21
      196.6.168.0/22
      196.6.172.0/23
      196.6.184.0/24
      196.6.198.0/24
      196.6.201.0/24
      196.6.212.0/23
      196.6.214.0/24
      196.6.221.0/24
      196.6.222.0/23
      196.6.237.0/24
      196.6.240.0/23
      196.6.243.0/24
      196.6.244.0/22
      196.6.248.0/22
      196.6.252.0/23
      196.6.254.0/24
      196.7.0.0/16
      196.8.0.0/15
      196.10.1.0/24
      196.10.2.0/23
      196.10.4.0/22
      196.10.8.0/21
      196.10.16.0/20
      196.10.32.0/20
      196.10.48.0/23
      196.10.50.0/24
      196.10.61.0/24
      196.10.62.0/23
      196.10.64.0/19
      196.10.96.0/24
      196.10.101.0/24
      196.10.102.0/23
      196.10.104.0/21
      196.10.112.0/22
      196.10.116.0/23
      196.10.118.0/24
      196.10.121.0/24
      196.10.124.0/22
      196.10.128.0/21
      196.10.136.0/24
      196.10.142.0/23
      196.10.144.0/23
      196.10.146.0/24
      196.10.149.0/24
      196.10.150.0/23
      196.10.152.0/21
      196.10.160.0/19
      196.10.192.0/20
      196.10.208.0/22
      196.10.212.0/23
      196.10.224.0/22
      196.10.229.0/24
      196.10.230.0/24
      196.10.232.0/21
      196.10.240.0/21
      196.10.248.0/23
      196.10.250.0/24
      196.11.0.0/20
      196.11.16.0/21
      196.11.24.0/22
      196.11.28.0/23
      196.11.30.0/24
      196.11.56.0/22
      196.11.60.0/23
      196.11.64.0/21
      196.11.72.0/23
      196.11.74.0/24
      196.11.91.0/24
      196.11.92.0/22
      196.11.96.0/22
      196.11.100.0/23
      196.11.105.0/24
      196.11.106.0/23
      196.11.108.0/22
      196.11.112.0/21
      196.11.120.0/22
      196.11.125.0/24
      196.11.126.0/23
      196.11.128.0/22
      196.11.132.0/23
      196.11.134.0/24
      196.11.136.0/21
      196.11.144.0/22
      196.11.148.0/23
      196.11.160.0/21
      196.11.168.0/22
      196.11.172.0/23
      196.11.174.0/24
      196.11.188.0/24
      196.11.192.0/21
      196.11.200.0/22
      196.11.204.0/23
      196.11.208.0/20
      196.11.224.0/22
      196.11.228.0/23
      196.11.230.0/24
      196.11.232.0/23
      196.11.235.0/24
      196.11.236.0/22
      196.11.240.0/21
      196.11.248.0/23
      196.11.252.0/23
      196.11.254.0/24
      196.12.16.0/20
      196.13.1.0/24
      196.13.2.0/23
      196.13.4.0/22
      196.13.8.0/21
      196.13.16.0/20
      196.13.32.0/19
      196.13.64.0/19
      196.13.96.0/22
      196.13.100.0/24
      196.13.113.0/24
      196.13.114.0/23
      196.13.116.0/22
      196.13.120.0/24
      196.13.127.0/24
      196.13.128.0/22
      196.13.132.0/24
      196.13.138.0/23
      196.13.140.0/22
      196.13.144.0/23
      196.13.146.0/24
      196.13.148.0/22
      196.13.152.0/21
      196.13.160.0/24
      196.13.162.0/23
      196.13.164.0/22
      196.13.170.0/23
      196.13.172.0/24
      196.13.184.0/23
      196.13.187.0/24
      196.13.188.0/23
      196.13.190.0/24
      196.13.200.0/22
      196.13.204.0/23
      196.13.210.0/23
      196.13.212.0/22
      196.13.215.0/24
      196.13.216.0/22
      196.13.220.0/23
      196.13.222.0/24
      196.13.224.0/20
      196.13.240.0/23
      196.13.246.0/23
      196.13.248.0/22
      196.15.0.0/21
      196.15.8.0/22
      196.14.0.0/16
      196.15.128.0/17
      196.16.0.0/14
      196.22.0.0/22
      196.22.4.0/24
      196.21.0.0/16
      196.22.16.0/20
      196.22.32.0/20
      196.22.64.0/18
      196.22.128.0/23
      196.22.132.0/22
      196.22.136.0/21
      196.22.160.0/19
      196.22.192.0/18
      196.23.0.0/16
      196.24.0.0/15
      196.26.0.0/16
      196.28.0.0/22
      196.28.4.0/23
      196.28.6.0/24
      196.28.8.0/24
      196.28.12.0/22
      196.28.16.0/20
      196.28.32.0/20
      196.28.64.0/18
      196.28.128.0/18
      196.28.192.0/19
      196.29.0.0/19
      196.29.128.0/19
      196.29.240.0/20
      196.30.0.0/15
      196.32.160.0/19
      196.39.0.0/17
      196.33.0.0/16
      196.34.0.0/15
      196.36.0.0/15
      196.38.0.0/16
      196.40.96.0/20
      196.41.0.0/19
      196.41.96.0/19
      196.41.128.0/18
      196.41.192.0/19
      196.43.0.0/18
      196.44.0.0/19
      196.44.32.0/20
      196.44.64.0/19
      196.44.192.0/19
      196.44.224.0/20
      196.45.16.0/20
      196.45.64.0/19
      196.45.96.0/20
      196.45.168.0/21
      196.45.176.0/21
      196.46.64.0/21
      196.46.112.0/22
      196.46.116.0/23
      196.46.136.0/21
      196.46.160.0/20
      196.46.176.0/21
      196.46.184.0/22
      196.46.224.0/21
      196.47.0.0/18
      196.47.64.0/19
      196.201.6.0/23
      196.202.248.0/22
      196.207.32.0/20
      196.208.0.0/13
      196.216.2.0/23
      196.216.16.0/21
      196.220.32.0/19
      198.54.1.0/24
      198.54.2.0/23
      198.54.4.0/22
      198.54.8.0/23
      198.54.10.0/24
      198.54.15.0/24
      198.54.16.0/20
      198.54.32.0/20
      198.54.48.0/21
      198.54.56.0/22
      198.54.60.0/23
      198.54.64.0/20
      198.54.80.0/24
      198.54.83.0/24
      198.54.84.0/22
      198.54.91.0/24
      198.54.98.0/23
      198.54.141.0/24
      198.54.142.0/23
      198.54.144.0/21
      198.54.154.0/23
      198.54.156.0/22
      198.54.160.0/22
      198.54.165.0/24
      198.54.170.0/24
      198.54.173.0/24
      198.54.174.0/23
      198.54.176.0/22
      198.54.180.0/23
      198.54.183.0/24
      198.54.184.0/21
      198.54.192.0/21
      198.54.202.0/23
      198.54.204.0/22
      198.54.208.0/23
      198.54.210.0/24
      198.54.219.0/24
      198.54.220.0/24
      198.54.223.0/24
      198.54.225.0/24
      198.54.226.0/23
      198.54.228.0/23
      198.54.231.0/24
      198.54.232.0/24
      198.54.234.0/24
      198.54.247.0/24
      198.54.248.0/22
      198.54.252.0/23
      198.54.254.0/24
      200.16.8.0/21
      204.12.128.0/20
      204.87.179.0/24
      204.235.32.0/21
      204.235.40.0/22
      205.159.79.0/24
      206.223.136.0/24
      209.203.0.0/18
      209.212.96.0/19
      213.193.32.0/19
      216.236.176.0/20
    • Say no to Internet Explorer 6.
      twitter.com/mark_up
    • GollumX's Avatar
    • GollumX
    • Elite Rocketeer
    • Posts: 2817
    • Thanks: 0

    Re: banning countries using htaccess

    Posted 17 years 4 months ago
    • damo's Avatar
    • damo
    • Elite Rocketeer
    • Posts: 2142
    • Thanks: 0

    Re: banning countries using htaccess

    Posted 17 years 4 months ago
    • thanks for help here guys.
      i could just use za instead of the ip though?
    • www.c3p0.se - sweden
    • GollumX's Avatar
    • GollumX
    • Elite Rocketeer
    • Posts: 2817
    • Thanks: 0

    Re: banning countries using htaccess

    Posted 17 years 4 months ago
    • If you follow the instructions below in the link (below) then you can just use ZAGollumX wrote:
      The better way requires that your host have a GEOIP module and mod_rewrite installed on the server. Email them asking for this. With this you can redirect your visitors from South Africa to a page saying your site is offline ... you can even make a copy of the default windows "site unavailable' page. You can also send them to a page with affiliate or adsense links, or you can send them to my site ;)

      Directions at http://www.affiliatewebsitedesign.com/forum/viewtopic.php?p=5679
    • Say no to Internet Explorer 6.
      twitter.com/mark_up
    • damo's Avatar
    • damo
    • Elite Rocketeer
    • Posts: 2142
    • Thanks: 0

    Re: banning countries using htaccess

    Posted 17 years 4 months ago
    • cheers again GollumX. its done. i just hope it works.
    • www.c3p0.se - sweden

Time to create page: 0.059 seconds