Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Redirect USA traffic away from a website

Posted on 2006-06-26
6
Medium Priority
?
256 Views
Last Modified: 2012-06-21
Is there a way to redirect traffic away from a site depending on whether it is coming from the USA or elsewhere?

The reason I ask is because we have a worldwide webside and a USA website. When USA people attempt to view the worldwide website they should actually be taken to the USA website instead. Google does this depending on which country you are requesting the page from.

0
Comment
Question by:craigdev
[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
6 Comments
 
LVL 37

Expert Comment

by:Harisha M G
ID: 16988503
Hi,

You need to check the IP address of the user. Typically this can be done using the server-side language like ASP, PHP etc.

---
Harish
0
 
LVL 1

Author Comment

by:craigdev
ID: 16988529
our CMS is php

What would you check the IP address against?
0
 
LVL 37

Assisted Solution

by:Harisha M G
Harisha M G earned 600 total points
ID: 16988562
craigdev, each country will have a set of numbers as the first/second octet of the IP address. You need to check whether that IP belongs to USA and redirect using header() if it doesn't.

$_SERVER['REMOTE_ADDR'] tells you the IP address of the user
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 8

Assisted Solution

by:Autogard
Autogard earned 600 total points
ID: 16988648
This is something that is quite difficult to do, even given the IP address, but you can get pretty close:

http://www.daniweb.com/techtalkforums/thread47999.html
http://www.hostip.info/
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 800 total points
ID: 17009864
Those techniques don't always work because the user's ISP may also
have his IP range registered in another country.

Unless ICANN renumbers all IP addresses in ranges for specific countries, like
radio station call letters or airplane registration numbers, it isn't going to
be reliable.
0
 
LVL 8

Expert Comment

by:Autogard
ID: 17009894
I agree, hence the "quite difficult to do" ... "but you can get pretty close".  :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

636 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