<%if Request.ServerVariables("SERVER_NAME")="www.a.com " then
response.redirect "a/index.asp"
elseif Request.ServerVariables("SERVER_NAME")="www.b.com " then
response.redirect "b/index.asp"
elseif Request.ServerVariables("SERVER_NAME")="www.c.com " then
response.redirect "c/index.asp"
else
response.redirect "aaa/index.asp"
end if%>
用一个asp文件通过浏览器输入的域名,判定他是要打开那个文件夹里的站点,来实现一个虚拟放置多个站点(缺点例如打开abc.com,在浏览器中看到的是abc.com/b因为站点在b目录下)
如果用户访问 www.a.com 程序跳转至 空间目录下 a/index.asp
如果用户访问 www.b.com 程序跳转至 空间目录下 b/index.asp
如果用户访问 www.c.com 程序跳转至 空间目录下 c/index.asp
如果用户访问 没有指定的 程序跳转至 空间目录下 aaa/index.asp空间上放多个网站