if (array_key_exists($_GET["id"], $path)) { header("location: " . $path[$_GET["id"]]); } else { header("location: http://yoursite.com/"); }