Many of the people developing or implementing the MultiSite module have already come to grips with the basic characteristics of the module. Others, like myself, are just starting to learn. Perhaps there is a need for a "pre-sales" thread to complement this rather technical "support" thread?
Anyway, I'd like to contribute a few important basics of the MultiSite module. Some of this is already documented elsewhere on this thread, more or less between the lines. If you miss some of this, or its true consequences, you may be in for a bit of a surprise later.
These are the issues that I as a newbie have been facing, and if someone ever creates a tutorial for the MultiSite Module I suggest that this information is included there.
The MultiSite module can save you a lot of time
If you manage multiple web shops, the MultiSite module can save you a lot of time:- You only need to maintain a single Zen Cart installation to host many shops.
- You can use the same product in more than one shop.
- A user that is defined in one of your shops can login to any of them.
- You can provide different company information for each shop.
- You can use different payment module for each shop.
- You can use different shipping modules for each shop.
There are certain limitations
- All the shops must use the same currency.
- To use SSL encryption smoothly you need one IP address per shop.
The same host account is used for all sites
To reap all the benefits of the MultiSite module you use only one host account, with one common Zen Cart installation, to support all your sites.
All domain names point to the shared host account
If you run site1.com, site2.com and site3.com using the MultiSite module, you will only create a host account for site1.com. The DNS entries for site2.com and site3.com both point to (are parked on top of) site1.com.
All sites use the same folder structure
Since all the domain names point to the same folder (the root folder for site1.com in the example above), any request for site1.com/zencart/ will access exactly the same file as site2.com/zencart/.
All sites are managed using the same Zen Cart Admin tool
It should be obvious to you by now that site1.com/zencart/admin/ and site2.com/zencart/admin/ access exactly the same file. You manage all your sites using the admin tool for the whole Zen Cart installation.
The MultiSite module knows what site to show
When the web server receives a page request, the environment variable $_SERVER['HTTP_HOST'] contains the domain name that was used (e.g. "site2.com"). The MultiSite module uses this information to use the right settings, fetch the right template, show the right categories etc. If the domain name is not correctly defined in the /includes/config_sites/ folder, there is no default - the screen will be blank except for a brief "undefined site" message.
Everything in the sites is shared - every folder, every file
Since site2.com and site3.com point to the folder structure for site1.com, there is no way to create a site1.com/help/ folder without also making the same folder available in the other sites.
If you need a partially separate folder structure for each site you may consider creating site1.com/s1/, site1.com/s2/ and site1.com/s3/. As you place items in the s1, s2, and s3 folders, they of course become available in all three sites at the same time. If you link to them correctly, i.e. site1.com/s1/ but site2.com/s2/ and site3.com/s3/, you maintain the impression of three separate sites. It is fairly unlikely that users will ever notice that they visit an account that hosts all three sites simultaneously.
Even the index page is shared
I use PHP, and so my index page (the page that is shown if someone just enters the domain name like "site1.com") is typically called index.php. In a multisite setup, this file is also shared - the same PHP script will be executed, regardless of what domain name the visitor used.
If you place the Zen Cart in your root folder, the MultiSite Manager will handle this automatically, and always provide the right site. If your site contains other things, it is quite likely that you have created a folder for your Zen Cart installation (e.g. site3.com/zencart/).
In this case you probably need a separate index page for each site. To achieve this, you need to create a script. I use PHP, and this is my new index.php file:
Code:
<?php
switch($_SERVER['HTTP_HOST']) {
case 'site1.com':
require('site1-index.php');
break;
case 'site2.com':
require('site2-index.php');
break;
case 'site3.com':
require('site3-index.php');
break;
}
?>
This uses the same technique as the MultiSite Module to show different content for different sites by using a separate index.php file for each site. From this site-unique file you create each site with its own content, templates, CSS files etc.