Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
$country_code = $_SERVER ["HTTP_CF_IPCOUNTRY"];
if ($country_code=="US") {
$link = 'http://us.domain.com';
}
else if ($country_code=="GB") {
$link = 'http://uk.domain.com';
}
else if ($country_code=="HK") {
$link = 'http://hk.domain.com';
}
header("location:$link");
exit;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment