Have I done country-based redirects right?


My site supports 12 translations, so I’ve set up redirects, but nothing appears to happen when users visit.

The URL is https://got-paper.com/

It’s a Nuxt site, here is my _redirects file:

/*    /index.html   200

# country redirects
# @see https://docs.netlify.com/routing/redirects/redirect-options/#redirect-by-country-or-language
/  /cs     302  Country=cz
/  /de     302  Country=at,ch,de,li
/  /es     302  Country=ar,bo,cl,co,cr,cu,do,ec,es,gq,gt,hn,mx,ni,pa,pe,py,sv,uy,ve
/  /fr     302  Country=bf,bi,bj,bl,cd,cf,cg,ci,dj,fr,ga,gf,gn,gp,mc,mf,mg,ml,mq,nc,ne,pf,pm,re,sn,td,tf,tg,yt
/  /gr     302  Country=gr
/  /id     302  Country=id
/  /it     302  Country=it,sm
/  /ru     302  Country=ru
/  /se     302  Country=se
/  /sr     302  Country=me,rs,sr
/  /zh     302  Country=cn,hk,mo,tw

I’ve asked a friend, and also used a VPN, but there are no redirects when I visit.

Am I missing something?


Have since changed these to languages, removed the * redirect, set my browser language to German, and still nothing:

# country redirects
# @see https://docs.netlify.com/routing/redirects/redirect-options/#redirect-by-country-or-language
/  /cs/     302  Language=cs
/  /de/     302  Language=de
/  /es/     302  Language=es
/  /fr/     302  Language=fr
/  /gr/     302  Language=gr
/  /id/     302  Language=id
/  /it/     302  Language=it
/  /ru/     302  Language=ru
/  /se/     302  Language=se
/  /sr/     302  Language=sr
/  /sr-cyrl/     302  Language=sr-Cyrl
/  /zh/     302  Language=zh

Hey @davestewart, very strange since the format of your file looks correct. I’m not sure how you’re loading this file but I wonder if you’d be willing to try putting the country-based redirects (which are more reliable than our language-based redirects at this point) in your netlify.toml instead of _redirects, and see if that works? I set up a small demo with a Nuxt site and was able to confirm with a vpn that at least the Italy redirect was working this way :slight_smile: Here’s what that would look like in your toml:

  from = "/"
  to = "/it"
  status = 301
  force = false
  conditions = {Country = ["it"]}

and so on…

Let us know how it goes.

Hey Jen,

Thanks for the reply!

I’ve archived the project now, so probably not going to spend the time getting this set up, but I know where to come when I next do i18n.