Multisite: Preferred redirection strategy from the domain root? #10163
Answered
by
aerni
helloDanuk
asked this question in
Q&A
-
What is the best strategy to redirect example.com to example.com/de in this setup below? Is this something I should do somehow in Statamic or is it a server level redirect? I would prefer to run the main language under the /de folder, as I do with the second language. Thanks for a little help in advance. main language:
second language:
my sites.yaml looks like this:
|
Beta Was this translation helpful? Give feedback.
Answered by
aerni
May 22, 2024
Replies: 1 comment
-
You can add the following code to your routes to redirect the user to the correct route based on the browser language: Route::redirect('/', '/'.request()->getPreferredLanguage(['de', 'fr'])); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
helloDanuk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can add the following code to your routes to redirect the user to the correct route based on the browser language: