在无IIS权限下,同一空间绑定多个域名

比如我们买了一个100M的空间,空间上并不支持子目录功能,那就需要如下的代码了:
程序代码 程序代码
<%

'取得HTTP输入的值并付值到HTOST中

host=lcase(request.servervariables("HTTP_HOST"))

'开始条件跳转

Select CASE host

' 如果HOST的值www.abc0.com就选择事件case"www.abc0.com"的命令

CASE "www.abc0.com"

' Below is the redirect command

response.redirect "Index.asp"

CASE "www.2abc.com"

' Below is the redirect command

response.redirect "bbs/"

CASE "abc0.com"

' Below is the redirect command

response.redirect "Index.asp"

' 继续添加...

'We use CASE ELSE to fix any other requests

CASE ELSE

response.redirect "index.asp"

END Select

%>


当然,如果你只有一个不需要备案的空间,而仅仅是需要用这个空间做一个跳转的话,可以用此方法把域名绑定到此空间上,然后转向其中一个文件,再然后跳转到国内空间的IP上。

跳转的代码比较多,这里列举一个常用到的:
程序代码 程序代码
<html> 
<head> 
<meta http-equiv="Content-Language" content="zh-CN"> 
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"> 
<meta http-equiv="refresh" content="0.1;url=http://116.255.00.00:60"> 
<title></title> 
</head> 
<body> 
</body> 
</html> 



评论: 0 | 引用: -1 | 查看次数: 4180
发表评论
昵 称:
密 码: 游客发言不需要密码.
验证码:
内 容:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭