I am using two languages on my Kirby site: German (default) and English. Works just fine! However, I would like to assign each language to a different domain: .de to German and .com to English. This is when things go wrong:
Before
Both the .de and the .com domain point to the exact same page. German is the default language in both cases. When you switch to English (in the frontend), an “/en” gets added to the URL. Works!
After (when trying to assign the languages to different domains)
Still, both the .de and the .com domain get you to the exact same page. Buuut: Both times in German. When you’re accessing the .de domain and try switching to English, you get forwarded to the .com domain, but everything remains in German. No way out, apparently.
PS — One strange detail I’ve noticed on the page as it is now (the “before” stage): When I type in the .de domain (German being the default language), a “/de” gets added to the URL even though it’s not specified in the de.php (only the en.php contains 'url' => '/en'.)
Just updated to Version 3.3.1. It doesn’t fix the problem, this is what happens now:
In the “before” setting (German is default, both domains point to the same page):
Still, a /de gets added after the domain even though the de.php file does not contain 'url' => '/de'
The image order is mixed up, but only in a few cases. Super strange: The image order as displayed in the panel is still correct! + When swichtich to English: Correct order again!
In the new setting (.de → German, .com → English):
Accessing the .de domain leads to an error report because of “too many redirects”.
Accessing the .com domain leads to the .de domain and eventually to the same error report.
Yes, I’ve emptied the caches (using the ⌘⌥E command in Safari) – is there something else that needs to be reset?
It’s really strange … I feel like the problem might be related to the de that suddenly shows up in the URL. Is has to come from somewhere, right? If it’s not in the de.php file, is there something else I should take a look at?
There shouldn’t be any manual links. The only precarious thing I found in the config.php is this one: 'home' => 'arbeiten' Could that cause the problem?
Sure! I have only one, this is what it looks like (mostly comments):
<?php
/*
---------------------------------------
License Setup
---------------------------------------
Please add your license key, which you've received
via email after purchasing Kirby on http://getkirby.com/buy
It is not permitted to run a public website without a
valid license key. Please read the End User License Agreement
for more information: http://getkirby.com/license
*/
// c::set('license', 'K2-PERSONAL-cfc19a42c089c1f1d705b302dcd75126');
/*
---------------------------------------
Kirby Configuration
---------------------------------------
By default you don't have to configure anything to
make Kirby work. For more fine-grained configuration
of the system, please check out http://getkirby.com/docs/advanced/options
*/
/* Languages */
// c::set('languages', array(
// array(
// 'code' => 'de',
// 'name' => 'DE',
// 'default' => true,
// 'locale' => 'de_DE',
// 'url' => '/',
// ),
// array(
// 'code' => 'en',
// 'name' => 'EN',
// 'locale' => 'en_US',
// 'url' => '/en',
// ),
// ));
return [
'debug' => true,
'home' => 'arbeiten',
'languages' => true
];
Hm, I don’t know. I have a working example running locally (also works if I set the home page to another page), and it works well on this site here: https://www.fabianhemmert.com/
So wondering what might be happening on your site.
And your domains all point to the same kirby project folder?
That doesn’t make sense, if you want to use different domains, the url property has to contain the domain. Maybe it’s a DNS issue with the second domain?
You’re right, this is my “before” setting (no differentiation between the two domains). The “too many redirects” problem occurs when I add 'url' => 'http://example.com' to en.php and 'url' => 'http://example.de' to de.php.