Netlify Redirects condition: country=gb are error hit the hongkong ip

  • Site name:
  • Redirects issues: our company’s export IP(HongKong) error hit the country=GB redirect.

netlify.toml config:

  from = "/"
  to = "/eu-en"
  conditions = {Country=["DE"]}
  status = 302
  from = "/"
  to = "/uk"
  conditions = {Country=["GB"]}
  status = 302

Our company’s export IP is:

but visit well redirect to AnkerMake | Explore the 3D Printing Frontier, it looks like hit the country=GB redirect
and when i choose sameone else ip at US / UK / DE it’s ok:

The better the post - the faster the answer.

Hey @dtc-shady , we’ve taken a look at your redirects and it looks like you don’t have one for Hong Kong. Can you add a redirect for Hong Kong and let us know if that helps?

Hey Amelia,

I’m create a lot of redirect with condition country=HK, but not work.

and rule code is:

Thanks for this @dtc-shady ! I’m wondering why you’re using 302 (temporary redirect) instead of 301 (permanent redirect) for all of these rules?

Additionally, can you try adding the force = true field to the first HK redirect and see if that makes any difference?

Hi Amelia,
We choose use 302 redirect course we don wanna browser to cache this redirect rules yet,
And will change to 301 redirect when this rules works good.
and now our redirect look work good, Our HK IP are not matched by the condition country=GB,
so its well done,
thank you, amelia.

Is you update your ip region database?

We update it regularly, so that could have been what fixed things, but I’d be a bit surprised to hear that that IP “moved” lately. Anyway, am glad to hear that things work better now!