From 269fd87a1d4309ac3ed59da111043c78b4c65d0f Mon Sep 17 00:00:00 2001 From: Karn Date: Sat, 2 May 2026 03:00:46 +0530 Subject: [PATCH] feat(deploy): add SPA fallback redirect for Cloudflare Pages Without this, deep links like /preview/ return 404 because Pages looks for a literal file. The wildcard rewrite to /index.html lets TanStack Router handle routing client-side. Real files (templates.json, assets, etc.) are still served before the redirect runs. Co-Authored-By: Claude Opus 4.7 (1M context) --- public/_redirects | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 public/_redirects diff --git a/public/_redirects b/public/_redirects new file mode 100644 index 0000000..acc8214 --- /dev/null +++ b/public/_redirects @@ -0,0 +1,4 @@ +# Cloudflare Pages SPA fallback. Any path not matching a real file is served +# index.html with a 200 so TanStack Router can handle the route client-side. +# https://developers.cloudflare.com/pages/configuration/redirects/ +/* /index.html 200