Prefix URL with different domain

Created on 12 January 2024, 6 months ago
Updated 22 January 2024, 5 months ago

Drupal Version

Version 10

We have several domain. All of them use site.com/ as German, French as site.com/fr and site.com/en as English.

In a new site we want to have site.com as French, site.com/de as German and site.com/en English.

If I configure is the path prefixes that way in Language detection when using the language Switcher the French version goes to /node/1 which makes sense.
Now the node is the homepage and its original language it's German. So when I go /node/1 it goes to German and the URL turns out site.com/de and I can't never get the french version again.

How do I do this? I tried changing the "Selected language" in /admin/config/regional/language/detection/selected for my new domain, but after saving the previous configuration in URL prefixes reverts back!

πŸ’¬ Support request
Status

Active

Version

2.0

Component

Documentation

Created by

πŸ‡ͺπŸ‡ΈSpain UriDrupal

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @UriDrupal
  • πŸ‡ͺπŸ‡ΈSpain UriDrupal

    So for anyone coming to this, the default fallback language can't be changed, Drupal only accepts one.
    I was able to hack it this way

    Basically what I did was changing the Fallback language to French.
    Then I went to Prefix URL, enable domain configuration for each domain, in my desired domain I put all the prefixes and save config.
    This means site.com/en, site.com/fr, site.com/de

    Then reverted fallback language to German.
    Now in my desired domain if I go example.com it goes to example.com/fr and lang switcher works properly.

    It's a bit of a hack but only way I could make it work. It won't show site.com as French, it will go to site.com/fr but at least it follows my directive of having certain domain be a default in another language.

Production build 0.69.0 2024