Solved

geo ip traffic

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AJAX pass along a variable 3 46
PHP breaks when used in Wordpress template file 3 30
jQuery Toggle & Anchor Links 5 43
Log in through ID 5 17
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

809 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