Multi-Site Implementation - Sitecore

Overview

This article explains how to setup multiple sites on a single Sitecore instance. The assumption behind this procedure is that each site is required to have its own domain name.

Procedure

1. Setup either DNS entries or your HOSTS File to all point to the IP address of the web server.

Sample HOSTS File
127.0.0.1       AcmeSitecore
127.0.0.1       AcmeSales
127.0.0.1       AcmeTechSupport

2. Within IIS, setup the bindings for your site to include the domain name of each site.

3. Within the <sites> section (i.e., /configuration/sitecore/sites node) of your web.config file, map each site to the desired Sitecore path.

Sample web.config settings'
<sites>
    <site 
        name="ACME Sales"  
        hostName="AcmeSales"  
        virtualFolder="/"  
        physicalFolder="/"  
        rootPath="/sitecore/content/Sales" . . .  
        />
    <site  
        name="ACME Tech Support"  
        hostName="AcmeTechSupport"  
        virtualFolder="/"  
        physicalFolder="/"  
        rootPath="/sitecore/content/TechSupport" . . .  
        />
    <site  
        name="ACME Main Site"  
        hostName="AcmeSitecore"  
        virtualFolder="/"  
        physicalFolder="/"  
        rootPath="/sitecore/content" . . .  
        />
. . .
</sites>

Site Node Attributes

The <site> node has the following attributes of interest.

AttributeDescription
nameA user-friendly name of the site
hostNameThe IIS Host Name for the website's bindings.
virtualFolderThe virtual path to the root of the web application.
physicalFolder(Not sure. Typically the same as virtualFolder.)
rootPathThe Sitecore path to the root folder of the website
startItemThe default item within the rootPath to display; akin to a default.html file.
databaseWhich database to use. Typically master or web.
requireLoginIf true, then except for the login page, EVERY web page in the site is unavailable to unauthenticated users, regardless of security permissions setup within Sitecore.
loginPageThe ASPX page to redirect to when an unauthenticated user attempts to navigate to a page that requires authentication.