Configure multiple managed websites
Add managed websites to a Sitecore installation.
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 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.
Important
When you choose a name for the website, you must avoid using characters that are invalid for the website cookies. Therefore, do not use control characters, spaces (" "), semicolons, or commas in your website names.
To configure an extra Sitecore website:
Add a patch file containing the new site definition.
Note
You must not add the definition directly to the
<sites>
list in theSitecore.config
file because changes to the file can be lost during an upgrade process.The following example adds a website called mysite:
<?xml version="1.0"?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <sites> <site name="mysite" patch:after="site[@name='modules_website']" targetHostName="rhino.acme.com” enableTracking="true" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content/mysite" 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" /> </sites> </sitecore> </configuration>
Important
It is important to pay attention to the order in which sites appear in the <sites> list. For more information, read about how website context is determined.
For each website you add, 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 theSitecore.config
file.Note
You must define all attributes for each website that you add. 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.In the
hosts
file of your computer or server, enter the host name of the website in the following format:102.54.94.97 rhino.acme.com # source server
Note
In the Sitecore.config
file, the Preview.DefaultSite
setting determines which website Sitecore displays if a user clicks Preview in the Sitecore Desktop menu. If a user does not have access to the default website, they get an error message.