From 0fae6d10093be7754d0969394ac09857a5752a70 Mon Sep 17 00:00:00 2001 From: Adrian Llopart Date: Sun, 21 Jun 2026 10:37:04 +0200 Subject: [PATCH] =?UTF-8?q?fix(routing):=20serve=20SPA=20for=20client=20ro?= =?UTF-8?q?utes=20=E2=80=94=20repair=20/privacy=20404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The narrow rewrite `/privacy -> /index.html` 404s on Vercel (production returns x-vercel-error: NOT_FOUND for /privacy, breaking the footer Privacy link). Replace it with the documented Vite-on-Vercel SPA catch-all that rewrites every non-/api path to /index.html, so the client router (App.jsx switches on window.location.pathname) can render /privacy — and any future client route — on a hard navigation. - `/api/*` is excluded so the contact serverless function is never rewritten; static assets keep filesystem precedence over the rewrite. - Verified in a headless browser: index.html served at /privacy renders the "Privacy notice" page (HTTP 200, pathname preserved). Pre-existing bug (rewrite added in bd44a88); unrelated to the security headers. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_0138qS6baPZutQ7s2fMbfNv3 --- vercel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vercel.json b/vercel.json index f74d438..d6df3a7 100644 --- a/vercel.json +++ b/vercel.json @@ -4,7 +4,7 @@ "outputDirectory": "dist", "cleanUrls": true, "trailingSlash": false, - "rewrites": [{ "source": "/privacy", "destination": "/index.html" }], + "rewrites": [{ "source": "/((?!api/).*)", "destination": "/index.html" }], "headers": [ { "source": "/(.*)",