See I have 100% success on any server with this
PHP Code:
if (getenv(HTTP_X_FORWARDED_FOR)) {
$ip = getenv(HTTP_X_FORWARDED_FOR);
}else{
$ip = getenv(REMOTE_ADDR);
}
so to turn this into what is needed...
PHP Code:
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();
}
I like the exit(); to make sure it doesn't run any more of the script even after it supposedly redirects.