Skip to content
● Grav 2.2.19 and 1.7.53.8 are out with security fixes found by Anthropic's OSS Scanner: update your sites. Read more →

Plugin to switch language based on FQDN?

Started by Muut Archive 10 years ago · 1 replies · 488 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 2781 9 years ago
Archive · by Muut Archive, 9 years ago
2 1826 9 years ago
Archive · by Muut Archive, 9 years ago
2 5148 9 years ago
Archive · by Muut Archive, 9 years ago
1 3975 9 years ago
Archive · by Muut Archive, 9 years ago
3 1924 9 years ago