|
|
Re: How to redirect user based on user country? [message #175637 is a reply to message #175633] |
Fri, 14 October 2011 09:42 |
justaguy
Messages: 16 Registered: December 2010
Karma: 0
|
Junior Member |
|
|
On Oct 14, 3:31 am, Arno Welzel <use...@arnowelzel.de> wrote:
> justaguy, 2011-10-14 05:00:
>
>> Hi,
>
>> I wonder how we can accomplish this task?
>> Say, a user from India lands athttp://www.knowledgenotebook.com/download.html
>> (actually it would behttp://www.knowledgenotebook.com/download.php)
>> I'd like to direct this visitor tohttp://bla.bla.bla.bla.in/download.html
>
>> And if the user is from China
>> it would be redirected tohttp://bla.bla.bla.bla.cn/download.html
>> so and so forth.
>
>> This approach would be more elegant if easily doable. If so how?
>
> You can use a GeoIP database (e.g. <http://www.maxmind.com/app/php>)
> which gives you a rough location based on the IP address of the client.
> This doesn't make sence of course without servers actually located in
> different countries.
>
> --
> Arno Welzelhttp://arnowelzel.dehttp://de-rec-fahrrad.de
All right, thanks, so, it's quite involved.
|
|
|
Re: How to redirect user based on user country? [message #175638 is a reply to message #175630] |
Fri, 14 October 2011 09:53 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 10/13/2011 11:00 PM, justaguy wrote:
> Hi,
>
> I wonder how we can accomplish this task?
> Say, a user from India lands at http://www.knowledgenotebook.com/download.html
> (actually it would be http://www.knowledgenotebook.com/download.php )
> I'd like to direct this visitor to http://bla.bla.bla.bla.in/download.html
>
> And if the user is from China
> it would be redirected to http://bla.bla.bla.bla.cn/download.html
> so and so forth.
>
> This approach would be more elegant if easily doable. If so how?
>
> Though another approach is also doable, messy.
> Download mirror site in India
> Download mirror site in China
> ...
>
> Thanks.
>
>
You can't do it reliably. You can only go by the user's ip address
using one of the geoip databases around.
But these databases have limited accuracy. They depend on the user's ip
address being in the same country as the user (which may or may not be
correct, especially for dial-up users and those using a proxy).
Additionally, they depend on an ISP not allocating ip addresses across
multiple countries.
Additionally, just because a server is in the same country doesn't mean
it's necessarily the best server to use. There are many reasons a
server in another country would be better.
A better way is to display a list of servers and let the user choose.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: How to redirect user based on user country? [message #175641 is a reply to message #175637] |
Fri, 14 October 2011 11:18 |
The Natural Philosoph
Messages: 993 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
justaguy wrote:
> On Oct 14, 3:31 am, Arno Welzel <use...@arnowelzel.de> wrote:
>> justaguy, 2011-10-14 05:00:
>>
>>> Hi,
>>> I wonder how we can accomplish this task?
>>> Say, a user from India lands athttp://www.knowledgenotebook.com/download.html
>>> (actually it would behttp://www.knowledgenotebook.com/download.php)
>>> I'd like to direct this visitor tohttp://bla.bla.bla.bla.in/download.html
>>> And if the user is from China
>>> it would be redirected tohttp://bla.bla.bla.bla.cn/download.html
>>> so and so forth.
>>> This approach would be more elegant if easily doable. If so how?
>> You can use a GeoIP database (e.g. <http://www.maxmind.com/app/php>)
>> which gives you a rough location based on the IP address of the client.
>> This doesn't make sence of course without servers actually located in
>> different countries.
>>
>> --
>> Arno Welzelhttp://arnowelzel.dehttp://de-rec-fahrrad.de
>
> All right, thanks, so, it's quite involved.
Yes.
You need to develop and probably manually maintain a database of IP
address blocks versus country.
|
|
|
Re: How to redirect user based on user country? [message #175645 is a reply to message #175637] |
Fri, 14 October 2011 17:09 |
houghi
Messages: 45 Registered: September 2011
Karma: 0
|
Member |
|
|
justaguy wrote:
>> You can use a GeoIP database (e.g. <http://www.maxmind.com/app/php>)
>> which gives you a rough location based on the IP address of the client.
>> This doesn't make sence of course without servers actually located in
>> different countries.
>
> All right, thanks, so, it's quite involved.
As long as you have recent updates for the data, it is not that bad.
However I personally detest it and rather be able to decide for myself.
As this is for download (and not so much the site itself) this is about
speed for the downloader, I assume. Even then I rather be able to select
my own mirror. I know I can have higher speeds from another country then
from my own on some servers.
So at least give the option to select during e.g. 15 seconds (or
whatever you think will be apropriate)
The example on the URL above is all that there is to it, but obviously
you must first decide which ones go where and where do the other ones go
to.
houghi
--
Dr. Walter Gibbs: Won't that be grand? Computers and the programs
will start thinking and the people will stop.
-- Tron (1982)
|
|
|
Re: How to redirect user based on user country? [message #175648 is a reply to message #175645] |
Sat, 15 October 2011 15:25 |
justaguy
Messages: 16 Registered: December 2010
Karma: 0
|
Junior Member |
|
|
On Oct 14, 1:09 pm, houghi <hou...@houghi.org.invalid> wrote:
> justaguy wrote:
>>> You can use a GeoIP database (e.g. <http://www.maxmind.com/app/php>)
>>> which gives you a rough location based on the IP address of the client..
>>> This doesn't make sence of course without servers actually located in
>>> different countries.
>
>> All right, thanks, so, it's quite involved.
>
> As long as you have recent updates for the data, it is not that bad.
> However I personally detest it and rather be able to decide for myself.
>
> As this is for download (and not so much the site itself) this is about
> speed for the downloader, I assume. Even then I rather be able to select
> my own mirror. I know I can have higher speeds from another country then
> from my own on some servers.
>
> So at least give the option to select during e.g. 15 seconds (or
> whatever you think will be apropriate)
>
> The example on the URL above is all that there is to it, but obviously
> you must first decide which ones go where and where do the other ones go
> to.
>
> houghi
> --
> Dr. Walter Gibbs: Won't that be grand? Computers and the programs
> will start thinking and the people will stop.
> -- Tron (1982)
Yeah, I agree listing mirror site may be a better choice. Thanks.
|
|
|