Page 1 of 1

Only Allow Access From Specific Geographic Area

Posted: Mon Mar 23, 2009 1:57 am
by braveryonions
How can I allow access to a site only from a specific area? I want to allow only people in my county to view my site.

Re: Only Allow Access From Specific Geographic Area

Posted: Mon Mar 23, 2009 2:58 am
by semlar
You can sort of, sometimes, get a moderate estimate of the geographical location of a visitor's ISP based on their IP address.

I wouldn't suggest restricting access using this method (personally, I wouldn't block anyone from viewing my site without a good reason).

There's probably a better solution for what you're trying to accomplish.

Re: Only Allow Access From Specific Geographic Area

Posted: Mon Mar 23, 2009 4:42 am
by php_east
braveryonions wrote:I want to allow only people in my county to view my site.
some people from your country may not be in your country. they may be travelling or may be working offshore.

Re: Only Allow Access From Specific Geographic Area

Posted: Mon Mar 23, 2009 5:14 am
by jayshields
I think websites like Pandora accomplish this with IP addresses. Although they can be spoofed and sometimes aren't accurate it's the only feasible means of doing it.

Re: Only Allow Access From Specific Geographic Area

Posted: Mon Mar 23, 2009 6:13 am
by php_east
here is a counrty-ip database i used for user tracking purposes on one module i made sometime ago, the database is free is relatively good, with users updating it and the site maitaining an updated version. it should be suffcient for your purpose.

this database at http://ip-to-country.webhosting.info
More informaton on this Database is at http://ip-to-country.webhosting.info/node/view/12.

you can then easily make a php or perhaps even .htaccess to manage your visitors.

enjoy.