[[redirects]]
from = "/api/*"
to = "https://api.example.com/:splat"
status = 200
force = true
headers = {X-From = "Netlify"}
[[redirects]]
from = "/*"
to = "/"
status = 200
force = true
headers = {X-From = "Netlify"}
Our React SPA needs to have client side routing and API forwarding. The first redirect entry above is for API forwarding and the second for client side routing. Previously we achieved client side routing through public/_redirects - but that breaks API forwarding. Any advice would be greatly appreciated.
My apologies, I overlooked the force = true initially—this was sending all requests, including the files/paths that do exist, back to index.html which is not desired in this instance.