Try our conversational search powered by Generative AI!

Customized Url Language-Market Routing



I am looking some advice on the best way to achieve the following.

We would like to change / introduce to the url a language and market segment e.g '','',''.

Has anyone tried something like this before?



Mar 02, 2023 9:28

If you setup languages via the manage website languages area within the admin section (including assigning the culture code you want to use in the URL path), and enable them, as well as adding fallback languages then you will be able to achieve what you need, examples of the steps to follow are in the screenshots below.

For your reference, here is the documentation on managing languages. 

Mar 03, 2023 8:58
Paul McGann (Netcel) - Mar 03, 2023 10:11
Hi Graham,

This approach did cross my mind, do you see any downside to this approach?

I take it you would need to write something to intercept the request and set the market accordingly?


Graham Carr - Mar 03, 2023 10:25
Hi Paul,
There are various approaches that you could take to set the market accordingly:

The preferred content language is determined by the following rules:

1. If you have defined the host name to be associated with a specific language, that language is used. The setting is specified under Manage Sites in admin view.
2. If there is a language segment in the URL (like, that language is used (en).
3, If you are in the edit view and have selected a specific language site from the Sites section, that language is used.
4. If the requests contain a query parameter or cookie named epslanguage, use the language defined by the query/cookie.
5. If the setting GlobalizationSettingsOptions.UseBrowserLanguagePreferences is true, then the language preference from the web browser is used.
6. Use the language mapped to wildcard host '*' if specified.
7. Fetch the setting from the GlobalizationOptions.UICultureLanguageCode.
8. If nothing else is discovered, use the first enabled language branch as defined in Admin / Language Branches, which means that it can be viewed as the default language.

I think points 4 and 5 relate directly to what you are asking, failing that you could go down the path of intercepting the route, there is some further information about Optimizely routing here:

and it is also worth mentioning that you can access the content language in various ways as described here:

I hope that helps you out.


* 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.