Disable Language Embedding in URLs and Sitecore Links

We know that Sitecore is a CMS and it supports multiple languages, hence the generated URL and Sitecore links will have a language appended to it for example(‘en’,’en-US’, etc.,). In this article, we will see How to Disable Language Embedding in URLs and Sitecore Links.

Most of the settings of Sitecore can be done without writing any additional code. We can easily disable language embedding in Sitecore by editing web.config’s <linkManager> section where the languageEmbedding option can be configured.

<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

Changing the config to use languageEmbedding="never" will stop the language from showing up in the URL, and likewise languageEmbedding="always" will force the language to always show up in the URL.

Note: Do not use the option “asNeeded” unless you are sure about what you are doing, as it might cause multiple URL’s for the same pages and this might affect the SEO of the site. Use either “never” or “always” which is much more SEO-friendly.

0 Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like
XOR in Python

XOR in Python

XOR Operator in Python is also known as “exclusive or”  that compares two binary numbers bitwise if two bits are…
How To

How to configure Git proxy?

If you are working in the corporate company all the internet requests usually goes through the corporate firewall.…