This article was originally published on Jo4 Blog.
My affiliate tracking links were returning the entire React app instead of a 302 redirect.
Not a 404. Not a 500. A perfectly happy 200 with my SPA's HTML shell. As if the browser was saying: "Here's your single-page application! You wanted a redirect? Never heard of her."
TL;DR
If you serve a React SPA from Cloudflare/CloudFront as a static bundle, every URL that doesn't match a static file falls through to index.html. That includes your API-style routes like /go/*. Fix it by adding a routing branch in your Cloudflare Worker that intercepts those paths at the edge before the SPA bundle even loads.







