Two or more domain names that share a single space and can be accessed independently _win servers

Source: Internet
Author: User
Tags servervariables
Meaning: Save a space that can be put together
If I loop the following code infinitely, I estimate that I can bind countless stations. Oh, of course, the premise is that your space business allows you to bind countless domain names, good, nonsense less, start writing code!!!!
The steps are as follows:

1, first of all, your space must support ASP, and this space can be bound to use the following two domain name (domain binding can let space service provider to help you do), and then create a new ASP's first file, the ASP file code is as follows:
Copy Code code as follows:

<%if request.servervariables ("server_name") = "www.jb51.net" Then ' first input URL
Response.Redirect "jb51/index.asp" forwards it to the appropriate folder
<%end if%>
<%if request.servervariables ("server_name") = "Jb51.net" Then
Response.Redirect "Jb51/index.asp"
<%end if%>
<%if request.servervariables ("server_name") = "tools.jb51.net" Then ' second input URL
Response.Redirect "tools/index.asp" forwards it to the appropriate folder
<%end if%>
<%if request.servervariables ("server_name") = "S.jb51.net" Then
Response.Redirect "S/index.asp"
<%end if%>

2, after writing this file to save for index.asp, that is, to do your home page. Don't worry, this is not going to show. This is to automatically identify the visitor input domain name, and then automatically jump based on the address entered by the visitor. Jump is done in an instant, you can not see. hehe ~ ~ ~ ~
3, now to do is to put your space to create two different folders, respectively, as a two Web site directory. Like a opwer folder. A Myk3 folder. Content in the contents of two websites!
4. Start uploading the index.asp file you just made! Upload the index.asp file to the space root directory.
5, to your space will be two domain names are bound, and then you can test.
Special tips:
1, attention to turn to the two domain name address must not write wrong. Otherwise it can't be realized! ~
2, the website design, as far as possible use relative address such as: ". /", do not use"/"otherwise the link may be wrong, but also easy to later split the site."
Description: The text by simple collation or original, reprint please indicate the source.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.