Support the ongoing development of Laravel.io →
Configuration Architecture
Last updated 2 years ago.
0

Any link, clue, keyword would be of greatest help, thanks!

Last updated 2 years ago.
0

You can use as many domain names as you like for any website. s1.maindomain.com is no different to www.someotherdomain.net, as far as the web server is concerned.

You'll need to point all your domains to your web server, then configure apache to serve those other domains with the same website, if you have access to the main apache configuration, you will see something like:

ServerName www.maindomain.com

You can add

ServerAlias www.maindomain.net www.maindomain.org www.maindomain.co.uk

You will then just have to configure laravel to resolve the domain name in use and modify the application based on that (probably in start.php). The router can have domain specific routes if required (see docs on subdomain routing for an idea where to start with that), and in start.php you would get the current domain and set the language/locale based on that for your translation support.

Once you have the locale auto-detecting by domain, you can then use the locale for any other purposes such as making locale specific database entries e.c.t. But of course that's getting into more of a multi-site territory, so you have to be prepared to do a lot of the code work to support that, as laravel doesn't come out of the box with multisite support (not that it's difficult, you generally just have to add a WHERE clause to every database lookup to limit the locale where applicable)

Last updated 2 years ago.
0

you can also set environment variable in your virtual host setup based upon the domain name

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

hexenium hexenium Joined 29 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.