Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Redirect based on IP address need URGENT HELP!!

Posted on 2000-04-03
5
Medium Priority
?
191 Views
Last Modified: 2006-11-17
I would like to redirect a person to a specific page by redirecting them based on whether they are in the united states or outside and send them to the appropriate page. I am not sure if javascript is the most appropriate
language but i am looking for some advice.
thanx
0
Comment
Question by:sonixusa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 2681218
Check for the supported language of the browser.
0
 

Author Comment

by:sonixusa
ID: 2681262
will that show the difference between the u.s. and canada, england, austrailia.. etc??
and do you have a sample script to look at??
thanx
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2681423
A better way is to reverse lookup the IP address on the server and redirect on domain.

However - the best way is to ask!!!

I use an english (internatonal) browser in Holland and I am Danish.
How do you know what language I want and what country I want to go to???

Michel
0
 

Expert Comment

by:yolish
ID: 2681916
Basing anything on the IP address is a risky situation due to the fact people might be dialing up to an ISP/Company in a different country, or if the users are going through a Proxy Server you run into all sorts of IP issues... It sounds like the best way is what CJ S mentioned, check what version/language of the browser the user installed and go from there... If that doesn't work, put a set of flags on a splash page and let the user decide....
0
 
LVL 10

Accepted Solution

by:
kollegov earned 600 total points
ID: 2682292
Using JavaApplet is the only way to get IP on client-side for MIE..

You can use my IPcatcher applet, you would find demo page here:
http://www.geocities.com/SiliconValley/Lakes/8620/vmaxipcatcher.html

It have javascript callback when IP detected it will call JavaScript function setIP(s)
IP is passed to this call as string.

This applet Work for NN3+, MIE4+

all you need is to parse IP address
and do whatever you need based on IP.

Main site entry
http://www.geocities.com/SiliconValley/Lakes/8620
(you would need it to reach downloads links)

--------------------------
If you need to do redirection for specific language than detecting IP wouldn't be best way. Many countries have several languages, so it will be
better to ask user ar at least try to
detect preferred language directly

<script>
if(document.all)lang=navigator.browserLanguage.toLowerCase()
if(document.layers)lang=navigator.language.toLowerCase()
alert(lang)
</script>

Than you would need to parse
standard abreviations like "en-us" in MIE and "en_us" in NN

Note that second token can be absent
you can get "en" only, and separator is different: NN use _ and mie use -

first token can be obtained

mainLang = lang.substring(0,2)

Next step is finding of best matching supported page.

if(mainLang=="en"){
  ....
}else if(mainLang=="fr"){
  ....
}

e.t.c

Virtual_Max








0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question