Netlify redirects vs NextJS default language

Hiiiii, loving netlify for many reasons but redirects based on country or language are problematic.

We’re using NextJS with EN as our default locale and FR etc for some other languages.

That is all fine until we try to redirect people in France to the fr language site:

  from = "/*"
  to = "/fr/:splat"
  conditions = { Country = ["fr"] }

This can kinda work but it also affects or breaks /fr links for people in France.
(Another side effect is that the SSG prerender seems to omit the root /fr page.)

How do other projects tackle this?

Many thanks,

PS: We’ve also discovered that redirects with accents do not work.
Both of these are defined in our _redirects file but only one works.
Do we need to encode non-ascii characters in some way?émarrage

Hey there, @George_A :wave:

Regarding redirects with accent marks, this thread should be useful for you. It looks like a fellow customer encountered this question last month, and using %C3%A9 instead of é worked.

Regarding language redirects and NextJS, I have looped in one of our Support Engineers. Thanks for your patience!

1 Like