Sitecore Multi-Sites with same domain but different Sitecore item node

Building sites on Sitecore which have different languages is easy. For example, you can implement the “XYZ” site in both English and Spanish versions using the default Sitecore site configuration.

In this post, I will explain how to setup a site which

The content tree structure is as shown in the screenshot below:

content tree.png

To setup the above scenario, the use of VirtualFolder is required. Most examples I have seen for VirtualFolder does not make use of the language as value. Example:

virtualFolder=”/en-us”

By default, if we use the virtualFolder=”/en-gb”, when Sitecore loads the URL, it will take the “en-us” as the language and will load the item version “en-US” instead of loading the 2nd site. So, let see the different steps to achieve the above requirements.

SiteDefinition

In your SiteDefintion.config, you need to set the virtualFolder and physicalFolder value as the same. No need to create the physical location for the physicalFolder attribute value. Example of the SiteDefinition:

untitled
LinkProvider

You need to set the LanguageEmbedded attribute to false since we will not need the Sitecore LinkProvider to carry the language within the path.

Capture.PNG

StripLanguage Setting

This is the most important part for the language to work as VirtualFolder. You need to set the value of the AlwaysStripLanguage setting to false.

You may patch the setting or change it from the Sitecore.config file. All you need to do is to search for AlwaysStripLanguage and change

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

to

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

Advertisements

One thought on “Sitecore Multi-Sites with same domain but different Sitecore item node

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s