One VM space creates multiple sites

Source: Internet
Author: User
One VM space creates multiple sites
1. Space supports directory binding domain names
Some space vendors support directory binding domain names, that is, I purchased a space and bound the domain name lonmo.com. I want to create another demo.lonmo.com space in the same space, you only need to create a directory and then bind it to the panel according to the instructions of the Space Provider. In this case, the new site is a sub-directory, such as the mythical network in China, the berhan network, and the vast majority of Space vendors in Europe and America. At this time, if you want to manage other sites, for example, if your program (Space) is bound with the domain name lonmo.com, and you want to manage Yahoo.com and demo.lonmo.com in the same space, perform the following operations:
(1) build an independent site according to the instructions of the Space Provider and bind the domain name. Now I have created the Yahoo directory in my website space and bound the domain name Yahoo.com to this directory, at the same time, the demo directory is created in the website space and the domain name demo.lonmo.com is bound to the directory.
(2) choose System Management> release point (PSN) to create an independent PSN for each site. Select a local machine for the release point (PSN) type, be sure to enter the correct local path (directory location) and URL (site domain name ). Now, I have created a release point (PSN) Yahoo. The local path is set .. /Yahoo. Set the URL to http://yahoo.com/#at the same time and set the tracking point (PSN) demo. Set the local path .. /demo, URL filled as http://demo.lonmo.com/
(3) choose Site Management> new node. Resource release pSNAnd Content publishing pSNFor example, we can create a root node using the release point (PSN) Yahoo and create a root node using the release point (PSN) demo.
After completing the above three steps, pay attention to setting permissions for all aspects, we can use a set of programs to manage multiple websites with different domain names at the same time.
2. The space does not support directory binding but supports alias setting.
Currently, most domestic space vendors do not support directory-bound domain names but support alias setting. That is, the content accessed by a space such as a.com, B .com, and c.com is the same. at this time, if you want to manage other sites, for example, if your program (Space) is bound with the domain name lonmo.com, and you want to manage Yahoo.com and demo.lonmo.com in the same space, perform the following operations:
(1) set the alias according to the description of the Space Provider. Now I have bound two aliases, Yahoo.com and demo.lonmo.com, to the space management panel, and created the Yahoo and demo directories.
(2) make a home page that can be redirected, so that when users enter different domain names, the corresponding files or directories are automatically redirected. The following shows an automatically redirected home page instance, save the following code as index.html to the root directory of the website.
<SCRIPT type = "text/JavaScript">
VaR host = new array ();
VaR url = new array ();
VaR size = 0;
/// // Part
Push (host, URL, "Yahoo.com", "/Yahoo ");
Push (host, URL, "demo.lonmo.com", "/cmsware ");
Push (host, URL, "wap.yahoo.com.cn", "WAP. WML ");
Push (host, URL, "soft.lonmo.com", "soft.html ");
Push (host, URL, "rerbin.changkong.org", "/blog/rerbin ");
//////////////////////////////////////
VaR req_url = Window. Location. href;
For (I = 0; I <size; I ++)
{
If (req_url.indexof (host [I])> = 0)
{
Window. Location. href = URL [I];
Break;
}
}
Function push (hostarray, urlarray, host, URL)
{
Hostarray [size] = host;
Urlarray [size] = URL;
Size ++;
}
Function Array ()
{
Return this;
}
</SCRIPT>

To add more domain names, you only need to add push (host, URL, "Yahoo.com", "/Yahoo"); such a row can be in the format of push (host, URL, "bound alias", "directory or file to be switched ");
At this point, when the user enters Yahoo.com will be automatically directed to http://yahoo.com/yahoo, enter wap.yahoo.com.cn will be automatically directed to http: // redirect from: http://blog.dayic.com/myblog/read.php/5.htm

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.