"Page Not Found" / "404: NOT_FOUND" when you refresh or open a deep link in your deployed React app
Page Not Found
Also appears as (2)
404: NOT_FOUND404 on refresh (React Router single-page app)
We reproduced the error and verified part of the fix; the parts we could not test are listed on the page. How we verify.
- Last verified
- Re-test due
- Published
- Fix ID
APP-02
Environment and versions
| os | Debian 13 (container) |
|---|---|
| node | 20.19.2 |
| vite | 8.3.5 |
| react | 19.3.1 |
| react-router-dom | 7.18.4 |
| netlify-cli | 27.14.2 (offline emulator) |
In brief
Your single-page app needs a fallback rule on the host. The full fix gives the exact file and line for Netlify and Cloudflare Pages, the Vercel equivalent, and when NOT to use it.
Symptom
Your Lovable, Bolt or Cursor app (React + Vite + React Router) deploys fine and the home page loads. But when you refresh on /dashboard, or someone opens a shared link to it, they get Netlify's "Page Not Found" or Vercel's "404: NOT_FOUND".
Why it happens
- Your app is a single-page app (SPA). The only real HTML file is
index.html; pages like/dashboardexist only inside your JavaScript. - Clicking a link works because React swaps the page without asking the server.
- A refresh asks the server for a file called
/dashboard, which doesn't exist, so the server returns 404.
What we could not test
- Real Netlify or Vercel deploys (no accounts).
vercel.jsonrewrites, becausevercel devneeds a login.- Cloudflare Pages, GitHub Pages and Azure.
The full fix
$4The free part of this page tells you what's wrong. The full fix tells you exactly what to do. It includes:
- Step-by-step fix, safest option first (the full page is 432 words)
- 1 copy-paste block of commands, config or code
- How to check it worked
- Our test record from Oct 26, 2026: what we ran and what happened
Launching soon. Checkout isn't open yet; prices may change at launch. Join the waitlist. You can check what you'll get: SHA-256 of the full fix 03c45d60dc667da8… (how to check).
Sources
- Stack Overflow: Netlify renders 404 on page refresh
- Stack Overflow: Page Not Found ... deployed on Netlify
- Stack Overflow: Vercel project 404 on refresh
- r/lovable: Lovable website shows Page Not Found on Netlify
- Netlify docs: redirects (file goes in the publish directory)
- Netlify support guide: I've deployed my site but I still see Page not found
How this page was made
Drafted by an AI agent and reproduced on our test machine on Oct 26, 2026. The scripts and logs are in the repro bundle; their file hashes are public on the repro page. Human review: not yet. No warranty: try fixes on a copy or staging environment first. Machine-readable versions: Markdown · JSON.
Found a mistake or a newer version where this breaks? Tell us.