Solved

geo ip traffic

Posted on 2006-10-30
3
440 Views
Last Modified: 2008-01-09
hello,
is there any tool out there that can redirect traffic from countries to a different page?
lets say my website is domain.com and if a country goes to my page redirect it to
domain.com/english.php or maybe a german country domain.com/german.php
is this possible ?
0
Comment
Question by:Sabrin
3 Comments
 
LVL 17

Expert Comment

by:HuyBD
ID: 17840209
As I know, It is depend on the client IP to specify the country
You can get client IP by $_SERVER["HTTP_CLIENT_IP"],$proxy = $_SERVER["REMOTE_ADDR"]
0
 
LVL 16

Accepted Solution

by:
HackneyCab earned 500 total points
ID: 17841167
It is not recommended to redirect users to different pages based on IP address (or IP-based country deductions).

If you want to serve different pages to people of different languages, then look at Apaches content negotiation modules.

If you want to serve different adverts to people from different countries (which is what I do) then take a look at maxmind.com who offer a free GeoIP database by country (which claims 97% accuracy, but does not work for AOL users). They also offer a premium database that claims to resolve IP addresses to city level, but I've never tried this. Their site gives example usage in several web languages, including PHP.

But I urge you not to create a single URL for multiple content versions. This will probably annoy search engines, which may think you're trying to trick them into indexing your page with certain keywords that don't appear in the standard version of the page.

If you're trying to appeal to multiple markets, offer a main .com page that has a country selector at the top, and then allow country choice to redirect the user to the sutiable domain or directory. (I believe that SEO experts recommend that you use .uk domains for sites aimed at the UK, .fr domains for sites aimed at France, etc.)
0
 
LVL 1

Expert Comment

by:Bolter99
ID: 17853615
<?
echo $_SERVER['HTTP_ACCEPT_LANGUAGE'];
?>

Maybe that could help?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

864 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now