Joe Bianco
Dec 21, 2009
(3 votes)

Setting Up Multiple Sites in EPiServer CMS 5 Enterprise

Multiple sites can be managed from the Structure pane in Edit Mode with EPiServer CMS 5 Enterprise.  This enables Editors to conveniently manage multiple sites from one interface and share content, Page Types, Page Templates, and other settings between them. 

To add additional sites to the Structure pane, a home page needs to be created in Edit Mode for each additional site as a sibling of the home page of the first site.  In addition, site elements need to be created and configured for each additional site in web.config. 

Note that the multiple site configuration requires an EPiServer CMS 5 Enterprise license.  When multiple sites are configured, the content for all of the sites is stored in a single database.

Example - Setting Up Multiple Sites in EPiServer CMS

The following example describes how to set up multiple sites in EPiServer CMS 5 R2 SP2.  This example uses the EPiServer Public Templates and IIS 7 so steps may vary slightly depending on your environment.


1. Using the EPiServer Deployment Center, create the first site and database.  You will need an Enterprise license file for this site.  The Deployment Center will create the necessary site element for the first site in web.config. image
2. In IIS Manger, edit the site binding for the first site and add a Host name (e.g. –

Note: If you plan to open up the template project for this site with Visual Studio, you will need to update the IISUrl element in the .csproj file to match the host name entered above.  For example, <IISUrl></IISUrl>
3. In IIS Manager, create the second site,  point the Physical path to the same directory as the first site, and specify a Host name

Note: If you are using IIS 6 or IIS 7 in Classic Pipeline Mode, you will need to configure a wildcard mapping.  Integrated Pipeline Mode is the default for IIS 7, so you will probably not need to do this.  If you do, see the “Configuring EPiServer CMS 5 R2 SP1 Enterprise” article for instructions.
4. If you do not have DNS entries set up for your sites, create host entries for the site in the hosts file on the machine from where you will be browsing to the sites (C:\Windows\System32\drivers\etc\hosts). image
5. In Admin Mode, make the [Public] Start page Page Type “Available in Edit Mode” so that you can create a new home page based on this Page Type.  image
6. In Edit Mode, create the home page for the second site, using the [Public] Start page Page Template, as a child page of the Root folder. Take note of the Page ID. image
7. In web.config…

  • Create a new site element for the second site by copying and pasting the site element of the first site.
  • Set the siteId and description attributes on the site elements for both sites.  The siteId must be unique.
  • Set the pageStartId attribute of the siteSettings element for the second site to the Page ID of the home page that you created above.
  • Set the siteUrl attributes of the siteSettings elements for both sites.  The siteUrl must be the fully qualified domain name including protocol (see screen shot).
  • Add a siteHosts element to both site elements containing add elements for each host name that will be used to reference each site.  Note that one of the siteHosts elements must contain exactly one add element with a wildcard “*” host name to handle requests that do not map to any of the other host names.  Each host name must be unique within the scope of the sites element.


Additional Considerations

To ensure that each site maintains a unique and consistent look and feel, a unique Page Type can be created for each site’s home page enabling Administrators to restrict which Page Types and Page Templates can be used within each site.  This also simplifies the “Create New Page” page by only displaying the available Page Types to Editors when creating new pages.


If you run into an issue where the children of secondary site will disappear in the Structure pane when selecting primary site or vice versa, this is probably because the uiUrl attribute of the siteSettings element in web.config was modified and is not root relative.  If you need to modify the uiUrl attribute, make sure it is a root relative path.  For example, uiUrl="~/cms/".

Dec 21, 2009


Sep 21, 2010 10:33 AM


I get this error when I try to call the second site, after the first has initialized:

Application is initialized with settings for siteId="x", but current request maps to siteId="y"
/ Lars

Sep 21, 2010 10:33 AM

Lars, I just had the same error. I am however using CMS 6. The instructions are slightly different so take a look here as well if your using 6:

In the end my problem was in episerverframework.config in the automaticSiteMapping where the siteId was duplicated as "DemoCMS6" for both settings and I needed to change the bottom one to my 2nd siteId:

Good luck!

Patrik Widman
Patrik Widman Sep 21, 2010 10:33 AM

I have the exact same problem as you Lars. Did you find any solution?

Sep 21, 2010 10:33 AM


Also having the same problem as you Lars. Did you (or Patrik) find a solution to this?

Lars Jensen
Lars Jensen Sep 22, 2010 09:45 AM


Yes, I found a solution. The wildcard should be at the last site, not the first, as in the above sample. So the line "" should be in "MultiSiteDemo2" - and it works!

Please login to comment.
Latest blogs
Vulnerability in EPiServer.GoogleAnalytics v3 and v4

Introduction A potential security vulnerability was detected for Optimizely Google Analytics addon (including EPiServer.GoogleAnalytics and...

Bien Nguyen | Sep 20, 2023

Overriding Optimizely’s Content Recommendations Block to Implement Custom Recommendations

Introduction The Content Recommendations add-on for Optimizely CMS dynamically recommends content from your site tailored to the interests of each...

abritt | Sep 13, 2023 | Syndicated blog

Developer contest! Install the AI Assistant and Win Bose QC45 Headphones!

We are thrilled to announce a developer contest where you have the chance to win a pair of Bose Headphones. The goal is to be the first developer t...

Luc Gosso (MVP) | Sep 7, 2023 | Syndicated blog

Send Optimizely notifications with SendGrid API, not SMTP

If your Optimizely site already sends transaction emails through an email platform API, why not do the same with Optimizely notification emails?

Stefan Holm Olsen | Sep 6, 2023 | Syndicated blog