Reputation: 6533
So I am trying to set up in sitecore to handle multi site set up with two different host headers. But no matter what I do it always reverts to default site with either host header.
So At the moment my default is in my web config as follows :
<site name="website" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/Home Page" database="web" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="10MB" registryCacheSize="0" viewStateCacheSize="0" xslCacheSize="5MB" filteredItemsCacheSize="2MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" hostname="localhost" loginPage="/Account/SourceLoginRouter" />
And the new one I am trying to add in then
<site name="SmartEmea" hostName="secondSite" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content/SmartEmea" startItem="/Home" database="master" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="10MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" language="nl-NL" customLinkManager="ValtechLinkManager"/>
And my host file is as follows
127.0.0.1 localhost
127.0.0.1 secondSite
But no matter what it always reverts to website and its rootpath
of /sitecore/content
Upvotes: 1
Views: 1452
Reputation: 31435
You must make sure the "website" <site ... />
node is LAST of all of the configured sites. This "website" node acts as a catch-all. As a request come in, it goes down the <site ... />
nodes and matches against each hostName
until it find a site to run. If you have "website" first, it will just run since it catches on any host.
E.g.
<site name="SmartEmea" hostName="secondSite" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content/SmartEmea" startItem="/Home" database="master" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="10MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" language="nl-NL" customLinkManager="ValtechLinkManager"/>
<site name="website" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/Home Page" database="web" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="10MB" registryCacheSize="0" viewStateCacheSize="0" xslCacheSize="5MB" filteredItemsCacheSize="2MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" hostname="localhost" loginPage="/Account/SourceLoginRouter" />
Upvotes: 5