canfiax
3 years ago

Using an optional subdomain for routes, with default fallback (for i18n)

Posted 3 years ago by canfiax

I'm working on preparing our Laravel 5.2 application for multilanguage.

I am thinking about sticking with subdomains to differ each language, i.e:

http://en.domain.com (english - default)
http://fr.domain.com (french)

But I'd like our default locale, i.e. english, to exclude the subdomain from the address, so I'd only be:

http://domain.com (english - default)
http://fr.domain.com (french)

Any ideas on how to do this?

Please sign in or create an account to participate in this conversation.