有一个ASP文件,有一个ASP空间,绑定了多少域名,使用不同的域名访问这个空间,可以重指定到不同的目录,现换一个PHP空间,也想实现这个功能,请教高手如何实现?
原ASP文件代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
<html>
<body>
<%
'取得HTTP输入的值并付值到HTOST中
host=lcase(request.servervariables("HTTP_HOST"
)
'开始条件跳转
SELECT CASE host
' 如果HOST的值是www.abc0.com就选择事件case"www.abc0.com"的命令
CASE "trade.netebuy.com"
' Below is the redirect command
response.redirect "trade/product/index.asp"
CASE "nantongonline.com"
' Below is the redirect command
response.redirect "index.htm"
CASE "www.nantongonline.com"
' Below is the redirect command
response.redirect "index.htm"
'We use CASE ELSE to fix any other requests
CASE ELSE
response.redirect "indexwyzg.asp"
END SELECT
%>
</body>
</html>
请教过别人说是可以用header和redirect来实现,因为初步更改如下,不过不行,希望高手帮忙改一下.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
<html>
<body>
<%
'取得HTTP输入的值并付值到HTOST中
host=lcase($HTTP_SERVER_VARS["HTTP_HOST"]
'开始条件跳转
SELECT CASE host
' 如果HOST的值是www.abc0.com就选择事件case"www.abc0.com"的命令
CASE "trade.netebuy.com"
' Below is the redirect command
Header("Location: $trade/product/index.asp"
;
CASE "nantongonline.com"
' Below is the redirect command
Header("Location: $index.htm"
;
'We use CASE ELSE to fix any other requests
CASE ELSE
Header("Location: $info.php"
;
END SELECT
%>
</body>
</html>