Note: This topic has no later version.
Table of contents
A multi-site setup is a solution that shares the same file structure and can store different types of information on the website in the same database. This document describes the configuration and technology behind this feature.
You will learn how to configure a multi-site setup, where several web applications share information by using the same files and database. When the configuration is complete, it is possible to link information from one website to another and edit any website in a single edit mode.
This configuration has the following restrictions:
- Each site that uses its own <site> section must have a unique Start page ID.
- Each site must use the same Wastebasket page ID and Root page ID.
1. Install the first website
Complete a regular EPiServer CMS installation using a license file that supports multiple sites.
2. Install additional websites
To set up multiple websites:
1. Create a new website in Internet Information Services Manager (IIS Manager).
2. Configure the home directory to point to the same home directory as your first website.
3. in EPiServer CMS Admin mode, from the Config tab, use Manage Websites to add site definitions.
4. Click the Add Site button and fill out the form. Be sure to add at least one host name.
5. Save the new site.
6. Click the Restart Sites button -- this is required to make the changes take effect.
Each site's unique configuration information is stored in the episerver.config file under <sites>. Each element has a siteId value.
The siteUrl attribute acts as a “default URL to the website” in cases where you need to generate links to the website without having a request to base the response upon, for example, in subscription scenarios.
<episerver> <sites> <site siteId="enterprise1" ... > <siteSettings ... siteUrl="http://enterprise1/" uiUrl="~/MyUIFolder/CMS/" ... /> <site siteId="enterprise2" ... > <siteSettings ... siteUrl=http://enterprise2uiUrl="~/MyUIFolderCMS/" ... /> </site> </sites> </episerver>
The siteId value is used to map each <site> element in episerver.config to a <siteHosts> element in EPiServerFramework.config.
<siteHostMapping> <siteHosts siteId="enterprise1"> <add name="*" /> <add name="enterprise1" /> </siteHosts> <siteHosts siteId="enterprise2"> <add name="enterprise2" /> </siteHosts> </siteHostMapping>
The <siteHostsMapping> element acts as a selector, determining which requests are routed to a specific enterprise instance.
Local and remote cache update
Since all sites share the same database and may be affected by content updates on other sites, the system needs to be able to sync changes between all the websites.
The cache update between sites, regardless of whether they are running on the same machine or not, is done via the Event System and must be configured separately to complete a multi-site setup.
A possible misconception regarding authentication in multi-site setup is that logging out on one site while being logged into other sites logs you out from these websites as well. This is not the case since authentication, by default when using Forms Authenticatoin, is stored in a cookie per site.