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.