Kirby 4 language redirect

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.

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();
},
]
]
];

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

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!

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.

It’s working now. Thanks again for clarifying.
Will do my best to format code questions properly in the future :upside_down_face: