Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Plugin to switch language based on FQDN?

Started by Muut Archive 10 years ago · 1 replies · 353 views
10 years ago

Hi all,

I was wondering if there was an option, or a plugin available that allows you to specify a language for a specific domain name so that you can control the language switching based on domain rather than a 2 letter code?

For example. I would like the following:

www.example.com => english
www.example.fr => french
www.example.de => german

Is there anything out there that does this? And if not, is this going to be doable in a plugin ( I am happy to write it and open source, just don't want to dive in if it already exists somewhere )

Thanks

10 years ago

Hi @afoozle, I don't know about any plugin, which comes with this feature. The usual way is to add some htaccess redirect rules, but you can of course redirect the user by a plugin. In order to do that I advise you to use the earliest possible event like onPluginsInitialized and prioritize it over all other events with a high priority like 100.000 in order to redirect the user as fast as possible to the right site.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1369 9 years ago
Archive · by Muut Archive, 9 years ago
2 942 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1125 9 years ago