Solved

geo ip traffic

Posted on 2006-10-30
3
434 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

705 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

13 Experts available now in Live!

Get 1:1 Help Now