PHP实现代码(将文件保存为index.php)
XML/HTML代码
- <?php
- switch ($_SERVER["HTTP_HOST"]) {
- case “www.abc.com”:
- header(”location:../abc”);
- break;
- case “www.def.com”:
- header(”location:../def”);
- break;
- ……
- }
- ?>
ASP实现代码(将文件保存为index.asp)
XML/HTML代码
- <%
- host=lcase(request.servervariables(”HTTP_HOST”)
- select case host
- case “www.abc.com”
- response.redirect “../abc”
- case “www.def.com”
- response.redirect “../def”
- ……
- end select
- %>