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. | |
2. | In IIS Manger, edit the site binding for the first site and add a Host name (e.g. – www.multisitedemo1.com). 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>http://www.multisitedemo1.com</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). | |
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. | |
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. | |
7. | In web.config…
|
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.
Troubleshooting
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/".
Hi,
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
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:
http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-60/Enterprise---Configuration/
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!
I have the exact same problem as you Lars. Did you find any solution?
Hi,
Also having the same problem as you Lars. Did you (or Patrik) find a solution to this?
Hi,
" should be in "MultiSiteDemo2" - and it works!
Yes, I found a solution. The wildcard should be at the last site, not the first, as in the above sample. So the line "