mrcl
September 4, 2025, 1:54pm
1
Hi everybody,
I run a multilanguage website with DE as my default. But for some reason the URL gets redirected to /de even with a proper language config declaration and no redirection declared in the htaccess. Is this a default behaviour in Kirby v4 or am I missing something?
All the best
Marcel
Would be great if you could share your config.
mrcl
September 5, 2025, 5:31am
3
sorry, my bad. Here it is:
return [
‘debug’ => true,
‘languages’ => [
[
‘code’ => ‘de’,
‘name’ => ‘Deutsch’,
‘default’ => true,
‘locale’ => ‘de_DE’,
‘url’ => ‘/’
],
[
‘code’ => ‘en’,
‘name’ => ‘English’,
‘locale’ => ‘en_US’,
‘url’ => ‘/en’
]
],
‘languages.detect’ => false,
‘kirby’ => [
‘component’ => [
‘file::url’ => function ($kirby, $file) {
return $file->url();
},
]
]
];
texnixe
September 5, 2025, 9:17am
4
The language configuration does not belong in the config file.
In config, you only define the languages option. The rest belong in the files under /site/languages
mrcl
September 5, 2025, 9:33am
5
Thank you for your reply. Just to clarify things:
The config should look like this then?
return [
‘debug’ => true,
‘languages’ => true,
// Enable SVG helper
‘kirby’ => [
‘component’ => [
‘file::url’ => function ($kirby, $file) {
return $file->url();
},
]
]
];
And the language files like this?
return [
‘code’ => ‘de’,
‘default’ => true,
‘direction’ => ‘ltr’,
‘locale’ => [
‘LC_ALL’ => ‘de_DE’
],
‘name’ => ‘Deutsch’,
‘translations’ => [
],
'url' => NULL
];
return [
‘code’ => ‘en’,
‘default’ => false,
‘direction’ => ‘ltr’,
‘locale’ => [
‘LC_ALL’ => ‘en_US’
],
‘name’ => ‘Englisch’,
‘translations’ => [
], ‘url’ => NULL
];
Thanks again for the lightning fast support!
texnixe
September 5, 2025, 9:47am
6
mrcl:
'url' => NULL
If you set url to null, Kirby will redirect / to /de, so need to set this to /.
Please wrap code inside three backticks before and after the code block to make your code readable.
mrcl
September 5, 2025, 10:12am
7
It’s working now. Thanks again for clarifying.
Will do my best to format code questions properly in the future