My app is an Angular SPA and a different build is created for each locale, for example:
/en-GB/
/en-US/
/fr-FR/
And so on.
I have been trying, and failing, to set up a conditional redirect that includes a splat and works with a SPA.
For example, I’d like to redirect /register
to /en-gb/register
for users arriving from the UK. However, while the redirect part works, it doesn’t seem to then do the proxying bit that makes the SPA work. Instead I get the Netlify 404 page.
This is the config I’ve got at the moment:
[[redirects]]
from = "/*"
to = "/en-gb/:splat"
status = 302
conditions = {Country = ["gb"]}
force = true
[[redirects]]
from = "/en-gb/*"
to = "/en-gb/index.html"
status = 200
I’ve tried with and without force and with a 200 status too.
I guess it is processing the redirect but then not the subsequent rewrite.
Any ideas how I would achieve what I want to do?
My site is https://go.squiggle.io/ but I’m experimenting on the staging
branch deploy.