Solved

Redirect USA traffic away from a website

Posted on 2006-06-26
6
244 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
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 150 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
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.

 
LVL 8

Assisted Solution

by:Autogard
Autogard earned 150 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 200 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

747 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

12 Experts available now in Live!

Get 1:1 Help Now