惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
TaoSecurity Blog
TaoSecurity Blog
Recorded Future
Recorded Future
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
A
Arctic Wolf
Last Week in AI
Last Week in AI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
CERT Recently Published Vulnerability Notes
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - 聂微东
有赞技术团队
有赞技术团队
GbyAI
GbyAI
博客园 - Franky
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Privacy & Cybersecurity Law Blog
AWS News Blog
AWS News Blog
T
The Blog of Author Tim Ferriss
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Vercel News
Vercel News
T
Tailwind CSS Blog
P
Palo Alto Networks Blog
Latest news
Latest news
阮一峰的网络日志
阮一峰的网络日志
S
Securelist
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Check Point Blog
Google DeepMind News
Google DeepMind News
The Cloudflare Blog
A
About on SuperTechFans
T
Threat Research - Cisco Blogs
Jina AI
Jina AI
The Hacker News
The Hacker News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Security Affairs
V
Visual Studio Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
J
Java Code Geeks
Cyberwarzone
Cyberwarzone
K
Kaspersky official blog
IT之家
IT之家
Project Zero
Project Zero
博客园 - 【当耐特】
Scott Helme
Scott Helme
罗磊的独立博客
人人都是产品经理
人人都是产品经理

博客园 - hzman

ASP采集入库生成本地文件的几个FUCTION 用XMLhttp编写web采集程序 无需安装软件架设NOD32升级服务器指南! 架设NOD32升级服务器 - hzman - 博客园 C#游戏外挂代码 VC7转换到VC8的常见问题 ini文件操作类 OllyDBG 入门系列(二)-字串参考 OllyDBG 入门系列(一)-认识OllyDBG - hzman - 博客园 live.cn邮箱注册帐号方法 - hzman - 博客园 免手机验证码网站备案 QQ空间代码说明 页面间传值方法 C#代码,功能为拦截http请求,并篡改其中任何内容 C#编写NotifyIcon 深入浅出之正则表达式 两个分析HTML网页的方法 提取HTML代码中文字的C#函数 c#字符串截取函数
ASP同一虚拟空间放多个站点(各站点对应独立域名)的方法
hzman · 2007-08-15 · via 博客园 - hzman

有时候买一个虚拟空间,足可以放N个站点,一般只要把各站点的对应域名都绑在这个虚拟空间的IP上,然后使用以下代码便可实现空间共享,站点独立 的效果

我们以ASP为例:
<%if Request.ServerVariables("SERVER_NAME")="www.weba.com" then
response.redirect "weba/index.asp"
elseif Request.ServerVariables("SERVER_NAME")="www.webb.com" then
response.redirect "webb/index.asp"
else
response.redirect "index.asp"
end if%>


这里有三个域名都绑在同一虚拟空间的IP
www.weba.com
www.webb.com
www.webc.com

将以上代码另存为 default.asp 放在站点根目下下(假定站点默认头文档为default.asp)

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