Try our conversational search powered by Generative AI!

Loading...
Area: Optimizely CMS

Recommended reading 

Note: This topic has no later version.

Table of contents

Introduction

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.

Configuration restrictions

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.

Installation

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.

Configuring Enterprise

3. in EPiServer CMS Admin mode, from the Config tab, use Manage Websites to add site definitions.

Configuring Enterprise

4. Click the Add Site button and fill out the form. Be sure to add at least one host name.

Configuring Enterprise

5. Save the new site.

6. Click the Restart Sites button -- this is required to make the changes take effect.

Technical details

Configuration files

Each site's unique configuration information is stored in the episerver.config file under <sites>. Each element has a siteId value.

 

Note The uiUrl attribute supports the application-relative syntax. The application-relative version of a uiUrl allows you to access the UI (edit and admin) with any host name you can use to access the site. If you enter a complete URL, you are restricted to accessing the site via that specific host name and port.

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.

XML
<episerver>
        <sites>
        <site siteId="enterprise1" ... >
        <siteSettings
        ...
        siteUrl="http://enterprise1/"
        uiUrl="~/MyUIFolder/CMS/"
        ...
      />
      <site siteId="enterprise2" ... >
      <siteSettings
        ...
        siteUrl=http://enterprise2uiUrl=&quot;~/MyUIFolderCMS/&quot;
        ...
      />
      </site>
      </sites>
      </episerver>

The siteId value is used to map each <site> element in episerver.config to a <siteHosts> element in EPiServerFramework.config.

XML
<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.

Additional information

Security

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.

See also

Do you find this information helpful? Please log in to provide feedback.

Last updated: Mar 25, 2013

Recommended reading