|
1个空间,无子目录,照样可以做两个以上不同的站
绵阳招聘">阿川博客那里看到的这个,其实现在这个也只是个免费的二级博客而已,暂时还用不到这个方法,这里为大家分享一下,希望对大家能有所帮助! 即使你的空间不支持子目录,一样可以做成两个或者以上不同的网站,先说实现方法: 复制下面的代码保存为 asp文件,命名为最高级别的默认页,比如 index.asp或者default.asp 两个不同的米都绑在相同的空间 当流量从 123.com或者www.123.com访问的时候,他自动识别并且跳转到 web/index.asp 即www.123.com/web/index.asp 相同,从aaa.com进入的浏览者,自动识别并且跳转到aaa.com/host/index.asp 代码: <%if Request.ServerVariables("SERVER_NAME")="123.com" then ’第一个输入的网址 response.redirect "web/index.asp" ’将它转发到相应的文件夹 else%> <%end if%> <%if Request.ServerVariables("SERVER_NAME")="www.123.com" then response.redirect "web/index.asp" else%> <%end if%> <%if Request.ServerVariables("SERVER_NAME")="aaa.com" then ’第二个输入的网址 response.redirect "host/index.asp" ’将它转发到相应的文件夹 else%> <%end if%> <%if Request.ServerVariables("SERVER_NAME")="www.aaa.com" then response.redirect "host/index.asp" else%> <%end if%>
|