Two different domains for one Flow Application

Hi,

I’ve currently running a Flow application and setting the language in an Aspect that checks for a language flag in the URL (don’t know if that’s a bad idea but it’s working fine).
Now I’m planning to use different URLs for different languages.
E.g. sub.domain.de for the german version and sub.domain.com for the english version.

Has anyone implemented such a thing or could recommend how to do it?
I guess it might work with the Aspect but that could get ugly.

Regards,
David

Hi David,

the best way to solve this would be an own HttpComponent that sets the current language according to the request domain name/TLD. You can take @bwaidelich’s HttpComponent as a base: https://gist.github.com/bwaidelich/03efc03f5bc1c87a3ae6

Should be rather easy to change it to take the locale from the TLD with some configured mapping of TLD => Locale identifier.

Feel free to share your findings on your implementation, as that is still something that would be quite useful in the core IMO.

Best Regards,
Alexander

1 Like

Hi Alexander,

thank you.
I’ll need some time until I implement this but I’ll definitely give this a try.

Regards,
David

You’re welcome. In case you struggle somewhere, don’t hesitate to ask here or on slack!

1 Like