Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #3406 > unrolled thread
| Started by | justaguy <lichunshen84@gmail.com> |
|---|---|
| First post | 2011-10-13 20:00 -0700 |
| Last post | 2011-10-14 05:53 -0400 |
| Articles | 7 — 5 participants |
Back to article view | Back to comp.lang.php
How to redirect user based on user country? justaguy <lichunshen84@gmail.com> - 2011-10-13 20:00 -0700
Re: How to redirect user based on user country? Arno Welzel <usenet@arnowelzel.de> - 2011-10-14 09:31 +0200
Re: How to redirect user based on user country? justaguy <lichunshen84@gmail.com> - 2011-10-14 02:42 -0700
Re: How to redirect user based on user country? The Natural Philosopher <tnp@invalid.invalid> - 2011-10-14 12:18 +0100
Re: How to redirect user based on user country? houghi <houghi@houghi.org.invalid> - 2011-10-14 19:09 +0200
Re: How to redirect user based on user country? justaguy <lichunshen84@gmail.com> - 2011-10-15 08:25 -0700
Re: How to redirect user based on user country? Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-14 05:53 -0400
| From | justaguy <lichunshen84@gmail.com> |
|---|---|
| Date | 2011-10-13 20:00 -0700 |
| Subject | How to redirect user based on user country? |
| Message-ID | <92d71fb7-3888-4f1f-a64b-7eae67ac0025@q4g2000yqh.googlegroups.com> |
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.
[toc] | [next] | [standalone]
| From | Arno Welzel <usenet@arnowelzel.de> |
|---|---|
| Date | 2011-10-14 09:31 +0200 |
| Message-ID | <4E97E53A.4090309@arnowelzel.de> |
| In reply to | #3406 |
justaguy, 2011-10-14 05:00: > 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? 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 Welzel http://arnowelzel.de http://de-rec-fahrrad.de
[toc] | [prev] | [next] | [standalone]
| From | justaguy <lichunshen84@gmail.com> |
|---|---|
| Date | 2011-10-14 02:42 -0700 |
| Message-ID | <745b9617-e5c1-4a62-89f8-9edae6915ec6@o14g2000vbd.googlegroups.com> |
| In reply to | #3409 |
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.
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2011-10-14 12:18 +0100 |
| Message-ID | <j795pf$vca$3@news.albasani.net> |
| In reply to | #3413 |
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.
[toc] | [prev] | [next] | [standalone]
| From | houghi <houghi@houghi.org.invalid> |
|---|---|
| Date | 2011-10-14 19:09 +0200 |
| Message-ID | <slrnj9gr67.3ru.houghi@penne.houghi> |
| In reply to | #3413 |
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)
[toc] | [prev] | [next] | [standalone]
| From | justaguy <lichunshen84@gmail.com> |
|---|---|
| Date | 2011-10-15 08:25 -0700 |
| Message-ID | <d5708008-0ddd-4267-8d8e-37679366e3eb@y35g2000pre.googlegroups.com> |
| In reply to | #3421 |
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.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2011-10-14 05:53 -0400 |
| Message-ID | <j790ra$5mk$1@dont-email.me> |
| In reply to | #3406 |
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@attglobal.net ==================
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web