3

Our site has only one language and therefore the '?la=en' parameter attached to several static assets (mainly images) is totally redundant.

Is it possible to remove this from the entire site?

3
  • what sitecore version are you using? Oct 16, 2017 at 8:00
  • The site is done in Sitecore version 8.0 Oct 16, 2017 at 9:40
  • 2
    How is your linkmanager configured? By default the languageEmbedding is set to asNeeded but what happens if you set it to never? Does this resolve your issue? Oct 16, 2017 at 10:15

1 Answer 1

1

Since your site only has one language you can configure the LinkManager to always generate URLs without any language parameters

You can configure this using a patch file:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <linkManager>
            <providers>
                <add name="sitecore">
                    <patch:attribute name="languageEmbedding">never</patch:attribute>
                </add>
            </providers>
        </linkManager>
    </sitecore>
</configuration>

And if at a later date you do want to enable languageEmbedding for a specific site you can have a look at this blogpost: https://jammykam.wordpress.com/2015/02/03/site-specific-link-provider-for-multi-site-implementation-in-sitecore/

3
  • I had updated the setting through direct edit of the web.config file. I understand that this may not be future proof and will apply a patch file for all the changes we have done. However, this does not solve the problem. Oct 18, 2017 at 13:19
  • You can try checking if the Languages.AlwaysStripLanguage setting is set to true. It should be by default. Oct 19, 2017 at 7:24
  • No success yet in global stripping. However, by avoiding the use of .ashx and directly using .png, .jpg etc, I am able to avoid suffixing ?la=en. Oct 30, 2017 at 9:58

Your Answer

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

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