Netlify Page Not Found on Refresh (SPA 404)
Quick answer
Client-side routes (React Router, Vue Router) 404 on refresh because Netlify looks for a real file. Add a /* /index.html 200 rewrite as a _redirects file in your publish directory.
Most likely fix: Add the SPA rewrite rule
How to fix it
Try these in order — the most common fix is first.
1. Add the SPA rewrite rule
- Create a file named _redirects (no extension) in your public/ folder so the build copies it to the publish directory
- Add the line: /* /index.html 200
- Redeploy and refresh a deep link
Did this fix it?2. Or use netlify.toml
- Add [[redirects]] with from = "/*", to = "/index.html", status = 200
- Commit and redeploy
Did this fix it?3. Check the file is in the deployed output
- Open the deploy's Deploy details > Deploy summary and confirm _redirects is listed
- Confirm the publish directory under Project configuration > Build & deploy matches your build output (dist, build)
Did this fix it?4. Force the rule when a file shadows it
- Use a status of 200! to override existing files, for example /app/* /app/index.html 200!
Did this fix it?5. Use absolute asset paths
- Reference assets as /assets/x.js not relative paths, or add a <base> tag, so rewritten routes load their files
Did this fix it?6. Fallback: HashRouter
- Switch BrowserRouter to HashRouter if you cannot add redirects
Did this fix it?
Symptoms
The home page loads, but refreshing or opening a deep link such as /about shows Netlify's 'Page not found'.
Why it happens
- No rewrite rule, so the server finds no file for the route
- _redirects file not copied into the publish directory
- File named _redirects.txt or saved with an extension
- A real file shadows the rule
- Absolute vs relative asset paths break on rewritten pages
This guide also covers
- netlify page not found on refresh
- netlify react router 404
- netlify _redirects not working
- netlify spa redirect
Still not working?
If Netlify keeps failing, you're not alone. See every Netlify problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
Other Netlify errors
- Netlify Build Failed
- Netlify Deploy Stuck on Building or Enqueued
- Netlify Custom Domain Not Working
- Netlify SSL Certificate Pending or Not Provisioning
- Netlify Function Timeout (502 / 504)
- Netlify Site Paused: Credit Limit Reached
- Netlify Build Failed: Secrets Scanning Detected Secrets
- Netlify Environment Variables Undefined