if (getenv(HTTP_X_FORWARDED_FOR)) {
$ip = getenv(HTTP_X_FORWARDED_FOR);
}else{
$ip = getenv(REMOTE_ADDR);
}
if ($ip == '10.0.0.2'){
header('location: http://www.url1.com/index.php');
exit();
}else{
header('location: http://www.url2.com/index.php');
exit();
}