Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Language Negotiation Url Matrix

Security covered Under active development 146 sites

This module helps manage complex language path and domain configurations by creating a clear mapping for how languages relate to specific paths, making language switching more intuitive for users. It addresses scenarios where different languages might be hosted on distinct sub-paths or sub-domains.

This module enhances Drupal Language Negotiation URLs. By providing a way to map languages to paths or domains in a way that does not confuse the User when using the Language Switcher.

Take for example a site with a domain called this.example.domain and it has two languages, french and english. Now this site exists on a path, let's say /lives/here for english and /habit/la for french. Now, let's assume the client also wishes prefixes to exist. Such that /lives/here/en is the final path for the english site and /habit/la/fr for the french. I know, sounds crazy, but it happens. The problem with this is that your combination of language paths now look like this:

  • this.example.domain/lives/here/en
  • this.example.domain/lives/here/fr
  • this.example.domain/habit/la/fr
  • this.example.domain/habit/la/en

As you can see, this is not ideal. We really need these to be the following:

  • this.example.domain/lives/here/en
  • this.example.domain/habit/la/fr

This module helps to map the languages to their path prefixes and domains. Ensuring a simple matrix of languages to paths.

In the event you have a site with multiple languages which exists in sub-folders and / or with sub-domains, in one combination or several. These can complicate matters for language switching. Especially since flipping between languages can impact legal or political matters.

This module attempts to provide a simple solution for getting around these problems.

Configuration

Please take a moment to review the documentation and make sure you've properly configured your server for use with this module. The module alone is not enough to make the paths and domains work as desired.

N.B.: There is some server level pathing required in some circumstances.

When using paths and domains which force the Drupal installation cookies to work with complex pathing, you will have to modify the parameters in the *.services.yml file:

parameters:
  session.storage.options:
    cookie_domain: '.localhost'
    cookie_samesite: 'Lax'

Note: If using a wildcard . to denote "anything before the domain", if you are using "domain matrix" the cookie may not work as intended. Either explicitly mark the domain or subdomain component which the cookie will adhere to otherwise user sessions won't work from one language to another.

Optional Modules

If you wish to take advantage of the Keys module to include and work with environment variables, this module makes use of the plugins it provides to create its own group of keys.

Drupal 9–10 · not 11

Ask your assistant about Language Negotiation Url Matrix

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • language Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
13
Tracked since
Aug 2023
Latest release
5 months ago
Releases (12 mo)
6 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
2.0.8 Stable 9–10 Apr 23, 2026
2.0.7 Stable 9–10 Mar 18, 2026
2.0.6 Stable 9–10 Mar 18, 2026
2.0.5 Stable 9–10 Dec 1, 2025
2.0.4 Stable 9–10 Dec 1, 2025
2.0.3 Stable 9–10 Nov 7, 2025
2.0.2 Stable 9–10 Jul 24, 2025
2.0.1 Stable 9–10 Nov 29, 2023
2.0.x-dev Dev 9–10 Oct 8, 2023
2.0.0 Stable 9–10 Oct 8, 2023