$ips = array( "a" => array( 'xxx.xxx.xxx.xxx', ....), "b" => array( 'xxx.xxx.xxx.xxx', ....), ); if(in_array($ips['a'], $_SERVER['REMOTE_ADDR'])) { header("location: website.com/a"); } else { header("location: website.com/b"); } exit;