Configure multiple managed websites

Last updated Tuesday, October 2, 2018 in Sitecore Experience Platform for Administrator

A single Sitecore instance uses multiple websites to manage content delivery, content management, and many other features. However, by default there is only one published website. This website corresponds to the <site name="website"…/> definition in the Sitecore.config file.

You can configure additional managed websites for different purposes and different domains by adding them to the site definition node in the Sitecore.config file. For example, you can define a new site to be your published public-facing site or to be used by content editors to access the content management system.


When you choose a name for the website, you must avoid using characters that are invalid for the website cookies. You should therefore not use control characters, spaces (" "), semicolons, or commas in your website names.

To configure an extra Sitecore website:

  1. Add a patch file containing the new site definition.


    You must not add the definition directly to the <sites> list in the Sitecore.config file because changes to the file can be lost during an upgrade process.

    The following example adds a website called admin:

    <?xml version="1.0"?>
    <configuration xmlns:patch="">
              <site name="mysite" patch:after="site[@name='modules_website']"
                enableTracking="true" virtualFolder="/" physicalFolder="/"
                startItem="/home" database="web" domain="extranet"
                allowDebug="true" cacheHtml="true" htmlCacheSize="50MB" registryCacheSize="0"
                viewStateCacheSize="0" xslCacheSize="25MB" filteredItemsCacheSize="10MB"
                enablePreview="true" enableWebEdit="true" enableDebugger="true"
                disableClientData="false" cacheRenderingParameters="true"
                renderingParametersCacheSize="10MB" />
  2. For each added website, configure the website attributes depending on the purpose of the website. The attributes and their purpose are described in the comments before the <site> section in the Sitecore.config file.


    You must define all attributes for each added website. Attributes can vary from version to version due to updates or new features in the product. Therefore, after any upgrade you must check the attributes for the default site in the Sitecore.config file, because there can be changes that require you to update the attributes of any added websites.

  3. Enter the host name of the website in the hosts file of your computer or server, in the following format:
          # source server

Website context

Sitecore determines the website context based on the incoming URL and the following two attributes:

  • hostName – Specifies the name of the website as it appears in the incoming URL. It can contain wildcards.
  • virtualFolder – The physical path to the website root folder.

When an incoming URL is received, Sitecore first compares it to the hostName attribute of each site in the <sites> list.

If the hostName attribute matches the incoming URL or the hostName attribute is empty, Sitecore compares the virtualFolder attribute next.

Sitecore uses the first site definition in the <sites> list where the hostName and virtualFolder attributes match the incoming URL as the context site.


Sitecore checks for sites in the order in which they are included in the list. Therefore, sites must be ordered starting with the most specific entry and ending with the most general entry. For example, if you have a website where hostName is and one where hostName is, the entry for must be first in the list. Otherwise, an incoming URL for will match the entry for first.

Send feedback about the documentation to