ASP multiple sites in the same virtual space (each site corresponds to an independent domain name)

Source: Internet
Author: User
Tags servervariables

Sometimes you can buy a virtual space for up to N sites. Generally, you only need to bind the corresponding domain names of each site to the IP address of the virtual space, and then use the followingCodeSpace sharing and site independence

Take ASP as an example:
<% 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 %>

Three domain names are bound to the IP address of the same virtual space.
Www.weba.com
Www.webb.com
Www.webc.com

Save the above Code as default. asp under the root directory of the site (assuming that the default header document of the site is default. asp)

If the user accesses www.weba.comProgramJump to weba/index. asp under the spatial directory
If you access the www.webb.com program and jump to the Webb/index. asp directory in the Space Directory
If you access the www.webc.com program and jump to index. asp under the spatial directory

Related Article

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.