<?php
$url1 = "http://w.skyfox.org/";//主網站
$url2 = "http://www.skyfox.org/"; //備用網站
$array = get_headers($url,1);
if(preg_match('/200/',$array[0])){ //200為正常代碼,經常見到的還有404,400,500等
echo "<script language='javascript' type='text/javascript'>";
echo "window.location.href='$url1'";
echo "</script>";
// echo "<pre/>";
// print_r($array);
}else{
echo "<script language='javascript' type='text/javascript'>";
echo "window.location.href='$url2'";
echo "</script>";
}
?>

