Hey,
I have two languages, FR and EN, but I don’t want mysite.com/fr and mysite.com/en. How can I do that?
For example, something like: mysite.com (english version) and mysite.com/fr (french version)
I’m running Kirby 1.1.2
Hey,
I have two languages, FR and EN, but I don’t want mysite.com/fr and mysite.com/en. How can I do that?
For example, something like: mysite.com (english version) and mysite.com/fr (french version)
I’m running Kirby 1.1.2
Look at Kirby Docs: languages > setup in the first config:
'default' => true,
'url' => '/',
Good luck!
Already tried that, but with no luck. Is this specific with Kirby 2 maybe, because there are 2 “types” of variables in config:
c::set('lang.support', true);
c::set('lang.default', 'fr');
c::set('lang.available', array('fr', 'en'));
c::set('lang.detect', true);
c::set('lang.locale', false);
and
c::set('languages', array(
array(
'code' => 'fr',
'name' => 'Français',
'default' => true,
'locale' => 'fr',
'url' => '/'
),
array(
'code' => 'en',
'name' => 'English',
'locale' => 'en_US',
'url' => '/en'
)
));
You only need the second configuration – the only option not covered by the options above is lang.detect
, if I get this right.
Edit: And you can leave away the slash in ‘url’, if you want; an empty string is sufficient.
Your first set is for Kirby 1, the second for Kirby 2, do not mix them. Since you are still on Kirby 1, you have to use the first set.
With Kirby 1, there is - as far as I know - no inbuilt way to get rid of the language code after the domain name, so what @anon77445132 suggested, will not work. However, you could try with url rewriting in your htaccess file.
Thank you all.
That’s what I thought
I’ll test the htaccess solution, or I’ll have to update to Kirby 2.