This article is provided by friends of WLZXALIU and WUWEICOL to the webmaster of this site. It is launched on [Wulin.com]. If you need to reprint, please write the copyright to show the author! Thank you.
A. Dynamic page
Step 1: Create a steering control page
Create the default homepage file (usually index.asp or default.asp) as follows:
- <%
- SelectcaseRequest.servervariables (http_host)
- casewww.vevb.com 'domain name 1
- Server.transfer (/index.asp)
- caseblog.vevb.com 'domain name 2
- Server.transfer (blog/index.asp)
- Casewww.chinabbs.cn 'domain name 3
- Server.transfer (BBS/Index.asp)
- '...... Continue to add ...
- Caseelse 'domain name N
- Server.transfer (xxx/index.asp)
- endselect
- %>
Step 2: Create the corresponding steering file
Create blog/index.asp ...... xxx/index.asp as homepage of each sub -directory website.
Step 3: Patcharge the IP address of multiple domain names to the same website space
For example: all the IP addresses of www.vevb.com ...... www.w2k.cn, etc. are all analyzed to the space where the web root directory of www.vevb.com is located.
Step 4: Bind the domain name you want to add to the space.
B.静态页面
js实现一个空间安装多个网站的方法:
1、在空间上分别绑定www.aaa.com 和www.bbb.com
2、把www.aaa.com 网站文件传到根目录,把www.bbb.com 网站传到./bbb/ 目录
3、 把下面的代码保存为domain.js ,然后上传到空间根目录
- switch(location.host){
- case 'www.bbb.com':
- location.href = http://www.bbb.com/bbb/
- Break;
- }
4. Add <head> and </head> on the homepage of the space root directory::
<script language = 'javascript' src = 'domain.js'> </script>
5. When you enter www.aaa.com, you can't see any changes when visiting, but when you enter www.bbb.com to visit, the browser will automatically jump to www.bbb.com/bbb/. In this way, two websites are installed in the same space, and multiple websites can be pushed in multiple websites.