Hey guys,
I am building a website with gatsby and hosting it on netlify. The website is available in two languages, french and english.
I want to redirect users from “/whatever” to either “/fr/whatever” or “/en/whatever” based on their browser language. I am using gatsby-plugin-netlify to create redirections using the following code:
createRedirect({
fromPath: '/pricing/',
toPath: '/fr/pricing/',
statusCode: 302,
Language: 'fr',
});
This appends the following code to my _redirects
file (which looks legit to me):
/pricing/ /fr/pricing/ 302 Language=fr
Now when I navigate to my website on /pricing and my Chrome settings show french as my only language, I expect to be redirected to /fr/pricing. It is not working as expected, no redirection is happening. Same behavior with Firefox, but in Safari it’s working well, I am redirected to /fr/pricing.
Here is my instance (it’s a preview):
https://5dd57f7f4f94f10008fcdda1–angry-brahmagupta-89f699.netlify.com/