4. PHP跳转代码默认文档设置1 :
< ?php switch ($_SERVER["HTTP_HOST"]) { case "www.a.com": header("location:a/index.php"); break; case "www.b.com": header("location:b/index.php"); break; case "www.c.com": header("location:c/index.php"); break; } ?>
PHP跳转代码默认文档设置2 :
< ?php $HTTP_HOST=$_SERVER['HTTP_HOST']; if(($HTTP_HOST=="a.com")or ($HTTP_HOST=="www.a.com")) {Header("Location:/index.html"); } elseif(($HTTP_HOST=="b.net")or ($HTTP_HOST=="www.b.net")) {Header("Location: /kangbite/"); } elseif(($HTTP_HOST=="c.com")or ($HTTP_HOST=="www.c.com")) {Header("Location: /c/"); } else {} ?> 以上就是PHP跳转代码的具体代码实现方法。 (责任编辑:最模板) |