2025年6月10日 星期二 乙巳(蛇)年 三月十四 设为首页 加入收藏
rss
您当前的位置:首页 > 计算机 > 编程开发 > ASP

Asp虚拟主机根据不同域名跳转

时间:09-10来源:作者:点击数:37
  • <%
  • sn=lcase(Request.ServerVariables("SERVER_NAME"))
  • if sn="www.a.com" then server.Transfer("a/index.asp")
  • if sn="www.b.com" then server.Transfer("b/index.html")
  • if sn="www.c.com" then server.Transfer("c/index.html")
  • %>

如果用户访问 www.a.com 程序跳转至 空间目录下 a/index.asp

如果用户访问 www.b.com 程序跳转至 空间目录下 b/index.html

如果用户访问 www.c.com 程序跳转至 空间目录下 c/index.html

  • <%
  • Response.Status="301 Moved Permanently"
  • Response.AddHeader "Location","http://www.a.com/"
  • Response.End
  • %>

所有访问都跳301到www.a.com

方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门
本栏推荐