Web Hosting Talk







View Full Version : How to block an Entire Country


ryza
11-29-2002, 03:43 AM
Hello,

Does anyone know how to Block an entire country with apache in a VHost.

ryza

AmericanD
11-29-2002, 03:47 AM
probably dont allow access in the .htaccess file

ryza
11-29-2002, 03:49 AM
well since u can use nilly every htaccess directive in a vhost i already know that much,
do you have any examples?

skelley1
11-29-2002, 03:56 AM
i dont think you can use htaccess to be country-specific since IP's are not country-specific. Some sites are testing the browser to see if it has certain languages enabled.

ryza
11-29-2002, 05:05 AM
skelley1, how can u test browser language? (in vhost)
i know web1000.com redirects all asian traffic to porn dialers instead of loading peoples homepages, and was wondering how its done.

skelley1
11-29-2002, 05:12 AM
unfortunately I'm not that savvy in that end of things to know how its done *hides business tie*

UH-Matt
11-29-2002, 05:19 AM
Originally posted by ryza
skelley1, how can u test browser language? (in vhost)
i know web1000.com redirects all asian traffic to porn dialers instead of loading peoples homepages, and was wondering how its done.


hahahah thats awsome! i never new that.

clockwork
11-29-2002, 05:51 AM
You'd need to dig around APnic and gather all the ip blocks you want to block.

Good luck if you try blocking by TLD, as most of users from Asia, from my noticing, do not have reverse dns.

Thanatos
11-29-2002, 04:27 PM
You could do this, or is this a stupid n00bish remark?

Order Allow,Deny
Allow from all
deny from .nl with .nl being the TLD for the to ban country

JamesS
11-29-2002, 04:42 PM
If you seriously want to block requests based on country, using a IP->Country product like GeoIP (http://www.maxmind.com/) is the only way to go. Blocking based on hostname isn't accurate, and many will slip through the net.