Wrong redirect for assets with Country condition

Hi,

I’m developing a website using gatsby and netlify.
I want to redirect users based a of Country, so i created a _redirects file.

Example : example.com/pricing => example.com/fr/pricing

/*        /fr/:splat       302       Country=FR
/*        /en/:splat       302       

The redirect works but all the assets are redirected too. I have no issues when I’m using Language condition or no condition. This happen just with the Country condition.

I seems that the country redirect is done even if a file is found at the given url. The other redirects are done just if the file is not found.

How can I fix that ?

25

Edit : I found are workaround but it’s not really seo friendly (two 302 redirects).

/country_redirect/*         /fr/:splat                      302         Country=FR
/country_redirect/*         /en/:splat                      302       
/*                          /country_redirect/:splat        302

That seems like normal behavior to me, if the assets don’t exist in / anyway? Since I don’t know which site you’re testing I can’t look in our database to understand your config, so please include your real URL instead of fake placeholders, if you’d like better advice!