3

When configuring a multi-site solution on Sitecore 7.2 Update 2, the client has decided to switch to a single domain. I would like to keep it as a multi-site solution in case the client decides for two domains in the future. There is minimal content that is shared across the sites.

I know that I can use https://marketplace.sitecore.net/en/Modules/Multiple_Sites_Manager.aspx. I am looking for other possible solutions as well.

The Sitecore Tree is:

sitecore
  |_content
       |_Personal
       |_Business
       |_Dictionaries

The Dictionaries are setup

Dictionaries
       |_Personal Dictionary : Fallback Global
       |_Business Dictionary : Fallback Global
       |_Global Dictionary

The sites configuration is below:

<site name="personal" 
            hostName="www.mydomain.com" 
            targetHostName="www.mydoman.com"
            virtualFolder="/" 
            physicalFolder="/" 
            rootPath="/sitecore/content/personal" 
            dictionaryDomain="{UniquePersonalDictionaryDomain}"
            patch:before="site[@name='modules_website']"/>
      <site name="business" 
            hostName="business.mydomain.com" 
            targetHostName="business.mydomain.com"
            virtualFolder="/" 
            physicalFolder="/" 
            rootPath="/sitecore/content/business" 
            startItem="/Home" database="web" 
            domain="extranet" allowDebug="true" 
            cacheHtml="true" htmlCacheSize="10MB" 
            registryCacheSize="0" viewStateCacheSize="0" 
            xslCacheSize="5MB" filteredItemsCacheSize="2MB" 
            enablePreview="true" enableWebEdit="true" 
            dictionaryDomain="{UniqueToBusinessDictionary}" 
            enableDebugger="true" disableClientData="false" />
        <site name="website">
            <patch:attribute
                 name="rootPath">/sitecore/content/public</patch:attribute
            <patch:attribute name="dictionaryDomain">{UniqueToBusinessDictionary}</patch:attribute>
        </site>
4
  • what is the question? Jan 31, 2017 at 19:39
  • How to configure a multi-site solution with a single domain. Instead of using www.mydomain.com and business.mydomain.com, I would like to use to www.mydomain.com for both sites.
    – C Sigmon
    Jan 31, 2017 at 19:45
  • What are you expecting as a functional URL for both sites? Something has to differentiate the other.
    – Pete Navarra
    Jan 31, 2017 at 22:51
  • Sorry for the delayed response. As a functional URL for both sites, we should see www.mydomain.com. After more troubleshooting, overriding the ItemResolver, I can achieve the expected result. My question is, is it possible to have 2 sites in the content tree and one URL? If so, what does the configuration look like?
    – C Sigmon
    Feb 14, 2017 at 4:04

1 Answer 1

6

If you will have the same domain but different rootPath, you will need to make use of the virtualFolder and physicalFolder attribute in the sitedefinition.config.

The virtualFolder and physicalFolder will allow you to use the same domain but having different sites that hits different rootPath. This will allow you to have less coding.

Site Definition Example:

enter image description here

Once the Site Definition is setup, patch the Sitecore setting AlwaysStripLanguage to set the value to false as shown below:

From

<setting name=”Languages.AlwaysStripLanguage” value=”true”/>

To

<setting name=”Languages.AlwaysStripLanguage” value=”false”/>

You may check my blog post how to setup it here: https://hishaamn.wordpress.com/2016/12/22/sitecore-multi-sites-with-same-domain-but-different-sitecore-item-node/

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.