Is it possible to redirect traffics based on country

J

jonathanthio

Say if the visitors come from German I'd redirect them to German
website, if vistors from USA, I'd redirect them to USA websites.

Is there a way to do this with javascript?
 
R

Randy Webb

(e-mail address removed) said the following on 9/4/2005 1:36 PM:
Say if the visitors come from German I'd redirect them to German
website, if vistors from USA, I'd redirect them to USA websites.

Is there a way to do this with javascript?

But if the visitor is from Germany visiting Canada and signing on with a
computer that is borrowed from a French friend, what site does he get?

The answer is no.
 
J

jonathanthio

I don't need something that accurate.

Are you sure the answer is no? Is there a non javascript alternatives?
 
J

jonathanthio

I mean where can I found out the IP range for Indonesian ISP?

Also, I can do something like

if lower<userIP<higher {
window.location=
else
window.location=
end if

things like that
 
L

Lasse Reichstein Nielsen

Say if the visitors come from German I'd redirect them to German
website, if vistors from USA, I'd redirect them to USA websites.

Is there a way to do this with javascript?

Client-side Javascript, no, not with any degree of accuracy.

You might try to check the navigator.userAgent string for signs
of a language (mine says "en" somewhere), but that's hardly
perfect (no, I'm not from England or any other country with
English as language).

/L
 
V

violet.zhu

maybe you could let the user make a language selection .
and then redirect to a proper page.
 
J

jonathanthio

The problem is not the language. The problem is that there is a new
business opportunities opportunity that's available only for Indonesian
citizen.

The languange is always english.
 
R

Robi

Say if the visitors come from German I'd redirect them to German
website, if vistors from USA, I'd redirect them to USA websites.

Is there a way to do this with javascript?

It depends what you want to do with the "redirected" user:
if you want to redirect the user to a page relevant to the country
he's "visiting from" - lets say he's looging in through a US ISP,
then you want to redirect to a US subsidiary of the website,
then I would be careful redirecting without making sure there is
an escape from it to a different "country" page.
assume some soldier in Guantanamo visits your page, does he get
the Cuban or the US page? Same applies for other countries: where
do you send someone from Belize? Just curious here.
I would let the user choose the country manually, then save that
info in a "cookie" letting the user, if necessary, change the
country in case he travels (or moves).

If you want to do this, you can use the server side variables
REMOTE_HOST which isn't always filled,
and
REMOTE_ADDR which can contain a proxied address - used also for
anonymous surfing

so, as you see, the above doesn't give you a clear or sure address
where your customer comes from.


If you need to redirect them for the language, then keep in mind
that every user can set language specific entries on their
browsers, but there are also browsers used by more than one user
(internet cafe) where every user can use a different language.
In that case I would also let the user choose the desired language
from a list of supported languages.


my 2 cents (and comments)
 
D

Dr John Stockton

JRS: In article <[email protected]>
, dated Mon, 5 Sep 2005 12:26:28, seen in (e-mail address removed) posted :
The problem is not the language. The problem is that there is a new
business opportunities opportunity that's available only for Indonesian
citizen.

In Indonesia, there are many people who are not Indonesian citizens.
Outside Indonesia, there are many people who are Indonesian citizens.
There may be Indonesian citizens in Indonesia who use company networks
that connect to the Internet from outside Indonesia.

You need a test on citizenship, not a test on location.

<p style="color: red; font: 160% sans-serif">
This business opportunity is available only for Indonesian citizens.</p>

Most readers will already know whether they are Indonesian citizens, and
can act accordingly; the rest will do well to find out.

If you want it to be secret and not known by Indonesians, then
(a) Don't put it in English,
(b) Don't put it on the Web.
 
A

aundro

Dr John Stockton said:
In Indonesia, there are many people who are not Indonesian citizens.
Outside Indonesia, there are many people who are Indonesian citizens.
There may be Indonesian citizens in Indonesia who use company networks
that connect to the Internet from outside Indonesia.

You need a test on citizenship, not a test on location.

Well, I think both tests (not at the same time! ;) ) make sense.
Look at google, for example: I, as a belgian citizen, am redirected to
www.google.be when I type www.google.com in the location bar.

... I ignore how they do that location check, though.
(IP ranges? Route? Anyone knows?)


Cheers,
Arnaud
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top