URL Maps (Multilingual)

Last Updated: Apr 24, 2023
documentation for the dotCMS Content Management System

dotCMS can automatically handle URL-mapped content in multiple languages. No change is required to the detail page and URL pattern of a given content type to accommodate multilingual content.

For information on how to set up URL mapped patterns on content types, please see the URL Map documentation.

Shared URL-Mapped Path

Although the page names may vary for each language-specific version of the content, it is recommended that different versions of content use the same URL-mapped path as the primary version.

Switching between these can be achieved by specifying the language_id URL parameter:

https://mydomain.com/example/multilingual-content?language_id=2

dotCMS automatically sets the language in the session to match the language of the version of the page chosen. If the URL-mapped pattern refers to a Spanish contentlet, then Spanish language is set in the session. When following another URL with multilingual URL-mapped content, the Spanish-language version will be chosen for display, if present.

If you use a language flag switch in the header, you may also use Velocity to check if there is URL Mapped content in that language, and then redirect the browser to the corresponding URL mapped address for the content in that language.

SEO Considerations

Please note that if different slugs are specified for different language versions, these will still route properly. However, this arrangement can complicate measures of page traffic, as an analytics suite may not be capable of associating traffic properly between the two versions without additional configuration.

An alternative method for handling translated slugs is to configure redirects such that translations of a URL can point to the same page, which can serve the appropriate content while logging traffic accordingly.

In all cases, please ensure that canonical URLs and hreflang tags are specified whenever appropriate.

On this page

×

We Dig Feedback

Selected excerpt:

×