

<?php
$ip = (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
$country = trim(file_get_contents('http://api.hostip.info/country.php?ip='.$ip));
switch($country)
{
case 'UK':
header('Location: http://www.domain.co.uk');
break;
}
//Etc
?>
Make sure you're taking proxies into mind here, the code should handle it, though.TheArbiter said:Does anyone know where i can get a simple javascript re-direct?
say someone goes to mysite.com
but they are from the UK so it redirects them to .co.uk
i searched good, but the one on there was confusing
and when it did work, it was constantly refreshing the page
Joe

