I have multi-lingual website, which has both English and Arabic languages. In the LinkManager
configuration languageEmbedding
is set to always, you can see the full configuration below.
As it is set to always, in menu (or wherever links are generated from the code), links are embed with language. When user manually types the URL in browser, language code would not be present, it still resolves properly (by reading the language from cookie). But we also need to change the URL by embedding the language code.
<linkManager defaultProvider="sitecore">
<providers>
<clear />
<add name="sitecore" type="Sitecore.Links.LinkProvider, Sitecore.Kernel"
addAspxExtension="false"
alwaysIncludeServerUrl="false"
encodeNames="true"
languageEmbedding="always"
languageLocation="filePath"
lowercaseUrls="true"
shortenUrls="false"
useDisplayName="false"
applyForSites=""
ignoreForSites="shell,login,admin"
forceFriendlyUrl="true"
trailingSlash="false"
onlyApplyForSiteContent="true" />
</providers>
</linkManager>
Can we achieve it by any processor or any redirect rules?