Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Language url segment in CMS 12

Vote:
 

Hi!

I am working on a new application in CMS 12. I have a multi language site. In the website configuration I have not chosen any culture.

When I try to use an url without any language segment (www.site.com/page) I get a 404 error... But if I add the language segment in the url everything works fine (www.site.com/en/page).

Is it possible to use an url without the language segment? If it is not present then I would like to use the page master language.

It worked fine in CMS 11... 

#300120
Edited, Apr 14, 2023 9:22
Vote:
 

How does your language settings look on the root page in CMS?

The settings in the web site config section is also interesting to see

#300238
Apr 17, 2023 7:52
Vote:
 

If you're building a multi-lingual site then all your languages should have a language component as this is a requirement for Optimizely to route into the correct language version of your content.  You could look at overriding the routing behaviour, but I wouldn't recommend it and I would consider what this means in terms of consistent behaviour of URLs and SEO.

#300243
Apr 17, 2023 8:13
Vote:
 

I have following settings:

and

In this solution there will be several StartPages for the same host that are in "Norwegian Bokmål" or "Norwegian Nynorsk".
The thing I would like to achieve is that if I use the url www.site.com/abc then it will show the page with the url www.site.com/nb/abc if the page abc is having the language "nb" as its master language. So both url's should work.

#300250
Apr 17, 2023 10:47
Vote:
 

Hi Robert,

You can do the following in appsettings.json

"EPiServer": {
        "Cms": {
            "RoutingOptions": {
                "StrictLanguageRouting":  false 
            } 
        }
}

This will assume the primary language can be served without the language component.  The canonical URL will still render with the language component, but it's best checking with your SEO team what this impact will have as you run the risk of search engines flagging your content up as duplicates and potentially harming your SEO ranking which could be bad.

#300251
Apr 17, 2023 11:16
Mark Stott - Apr 17, 2023 11:35
You can read more about CMS Configuration here: https://docs.developers.optimizely.com/content-management-system/docs/configuring-cms
Robert Tellvik - Apr 18, 2023 4:31
Thanks!
This one solved it :)
Vote:
 

If you want to get rid of the language segment, then you just need to map a host to a culture in your site settings.

#300264
Apr 17, 2023 21:07
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.