Multiple domain, one core

Is it possible to have one core and multiple domains? E.g. for the English language the domain will be for the Polish language the domain will be, how please set up the routes to make it work this way? Then, if I call another language page in the project, how is it listed that it is in case I switch to Polish?

If I would like to have more domains in the project, eg will display different content, how to define?

Thank you

Hi @shadowx.jb,

You can leverage prefix routing for this.

First you should add condition in your routes.php file to dynamically decide the prefix. For example:

if ($_SERVER['HTTP_HOST'] === '') {
    $prefix = 'en';
} elseif ($_SERVER['HTTP_HOST'] === '') {
    $prefix = 'es';

And then pass as prefix routing.

Then you can get the prefix in your controller to dynamically set translation language.

One thing with this approach is you end up creating particular prefix route specific controller along with your main controller that you should inherit to. So you can handle any prefix specific logic into its own controller.