Case Surf.com
Index -> About Us -> Add Your Link -> Privacy of Info -> Terms & Conditions -> Submit Article
Search:   
 

Data Recovery Methods

Specialists in data recovery will take your hard drive and evaluate it. - Michael Russell
 

Motorola v3x ?C as stylish as it gets..!!

Supremely stylish, sleek and sophisticated motorola v3x, this is one gem mobile phone of all the mot ... - Alice
 

Audio Books and MP3 Players - A Perfect Couple?

Find out what should you take into account when buying a MP# player for the purpose of listening to ... - Paton Jackson
 
 

Ready for a Career Change? Travel the Microsoft Certification Route

Are you dissatisfied with your job? Do you want to find a new one or at least make a move to another ... - James Croydon
 

List Building: Quality Vs Quantity

Would you rather have a list of 200,000 people that may buy from you or a list of 2,000 that absolut ... - Bette Daoust, Ph.D.
 

List Your Ezine In Directories And Forums

We're going to go into a little more detail concerning the topic of getting your Ezines listed in di ... - Ken Mathie
 

Solitaire Game Guide

Despite what you may think, solitaire isn't actually one specific game... it's actually an entire ca ... - Dan Fletcher
 

Web Coach Tip: The Truth Is Out -- Confessions of a Web Pro

Confessions of a Web Pro, stale web sites can fester like a nagging cold, left untreated creates big ... - Donna Payne
 
 

Index » Computers & Software » E Commerce Service Providers
 

Redirect Web Visitors By Country Using ASP and COM Technology

 
Author: Ivy Tang
 

There are times when it is useful to redirect a visitor to different default web page based on the visitor's country of origin. One practical usage is to redirect visitor to web page with the language recognized by the visitor. This article shows you how using ASP and ActiveX component this can be done.

Let us take a simple case study. Company XYZ is multi-national company with major customers from United States and Japan. The company official website is developed in both English and Japanese languages. The default page is in English language and visitor can switch to Japanese by changing the default language option. There exists a potential problem when a Japanese visitor does not understand English and it could not navigate the web site. So let us developed a simple solution to help Company XYZ redirecting all Internet traffic from country Japan to the Japanese language site. Meanwhile it drives the rest traffic to English site.

In this example, we use a fully functional IP2Location ActiveX component available at http://www.ip2location.com/ip2location-country.zip to query country by visitor's IP address. For unregistered component, there is a 5-second delay in every query. First, install the ActiveX component in IIS web server. It could be as simple as running a command in DOS prompt.

C:> regsvr32 ip2location.dll

Let's assume the English web page as index_en.htm and Japanese web page as index_jp.htm. We implement a simple script default.asp to detect visitor's country of origin. If the visitor is from Japan, then redirect him/her to index_jp.htm, otherwise index_en.htm. Simple? Here is the code and the comments serve as explanation default.asp.

<%

' Create server-side object

Set ipObj = Server.CreateObject("IP2Location.Country")

' Initialize IP2Location object

If ipObj.Initialize("demo") <> "OK" Then

response.write "IP2Location Initialization Failed.

End If

' Get visitor's IP address

IPaddr = Request.ServerVariables("REMOTE_ADDR")

' Detect visitor's country of origin by IP address

CountryName = ipObj.LookUpShortName(IPaddr)

' Free IP2Location object

Set ipObj = nothing

If CountryName = "JP" Then

' Visitor is from Japan

' Redirect the URL to index_jp.htm

Response.Redirect "index_jp.htm"

Else

' Visitor is not from Japan

' Redirect the URL to index_en.htm

Response.Redirect "index_en.htm"

End If %>

Place this script as the default script of the web site. All visitors will go through this screening before redirect to an appropriate web page

 
 
 

Related Articles

 
Will RSS Replace Email?
 
How Paid Online Surveys Financed My First Web Site!
 
Back it UP!
 
Getting Your Information Technology Career Started
 
The ROR Advantage: No Spider Discrimination!
 
Political Online Forum Debates
 
How to Increase Your Opt In List by 322% in 28 Days
 
A Basic Introduction to Blogging
 
DXInOne - Issue #2 - We Have Enough DXInOne Marketers Already, Right?
 
New Algorithm Measures Require New Means For Optimization
 
 
 
Add Url
 

Computers & Software

News & Media

Sports & Adventure

Jobs & Careers

Academics & Education

Science & Space

Creative Arts

Self Help

Indoor Games

Hygiene & Health

Fashion & Relationships

Companies & Business

Estate & Realty

Society & Communities

Food & Recipe

Travel & Accommodation

Government & Politics

Children & Teens

Home Family & Garden

Medicine & Treatment

Online Shopping

Finance & Banking

Recreation

Automotive

 
Index -> Privacy of Info -> Terms & Conditions  
Copyright © 2008 www.casesurf.com All Rights Reserved.