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
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.
To configure an extra Sitecore website:
- Add a patch file
containing the new site definition.
The following example adds a website called admin:
<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"
- 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
- Enter the host name of the website in the
hostsfile of your computer or server, in the following format:
188.8.131.52 rhino.acme.com # source server
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
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
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 mysite.com.au and one where
hostName is mysite.com, the entry for mysite.com.au must be first in the list. Otherwise, an incoming URL for mysite.com.au will match the entry for mysite.com first.