Because Sitecore is a CMS that supports multiple languages, you may often notice that links generated from code have the language specified in the link (for example, ‘en’). If you don’t want the language embedded in generated links, you can disable that option in the following section of Sitecore’s web.config:
<linkManager defaultProvider="sitecore"> <providers> <clear /> <add name="sitecore" type="Sitecore.Links.LinkProvider, Sitecore.Kernel" addAspxExtension="true" alwaysIncludeServerUrl="false" encodeNames="true" languageEmbedding="never" languageLocation="filePath" lowercaseUrls="false" shortenUrls="true" useDisplayName="false" /> </providers> </linkManager>
For your reference, the languageEmbedding options are:
- asNeeded (default)
- always
- never