I've a multilingual website which use the language prefix for each language.
Take an example: my domain name is "example.com".
When I use example.com/fr, i'm redirected to the french language and the language cookie is set to "fr". Normal behavior indeed.
So I restart my browser and I use the url without prefix (example.com).
Normaly, I will be redirected to the french language... No, i'm always redirected to the website default language.
This cause by the option "Frontpage Redirect Handler" in the module "Global Redirect".
I've no possibility to disable this option.
My goal is to be redirected to the right language (in cookie) without disable this option.
A "nice to have" will to be redirected to an URL with the right language prefix.
Example:
If my cookie is set to "fr" and I use "example.com", i want to be redirected to "example.com/fr".
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | Patch to use with one language prefix by language. | 1.53 KB | Echofive |
| #1 | Patch to use with one language prefix by language. | 1.53 KB | Echofive |
Comments
Comment #1
Echofive commentedI've written a patch to do what I need.
My solution is based on the hook_url_outbound_alter().
The "Global Redirect" module invokes all of this hooks to set the redirection.
For me it work fine but probably don't fixes all cases...
It's interesting to test:
The language management is complex and I've no time to test all cases.
Comment #2
Echofive commentedSorry bad patch name :(