Netlify Page Not Found on Refresh (SPA 404)

Share
Fixed in latest version Web, CLI Updated November 13, 2026Based on 4 user reportsHow we research

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. 1. Add the SPA rewrite rule

    1. Create a file named _redirects (no extension) in your public/ folder so the build copies it to the publish directory
    2. Add the line: /* /index.html 200
    3. Redeploy and refresh a deep link
    Did this fix it?
  2. 2. Or use netlify.toml

    1. Add [[redirects]] with from = "/*", to = "/index.html", status = 200
    2. Commit and redeploy
    Did this fix it?
  3. 3. Check the file is in the deployed output

    1. Open the deploy's Deploy details > Deploy summary and confirm _redirects is listed
    2. Confirm the publish directory under Project configuration > Build & deploy matches your build output (dist, build)
    Did this fix it?
  4. 4. Force the rule when a file shadows it

    1. Use a status of 200! to override existing files, for example /app/* /app/index.html 200!
    Did this fix it?
  5. 5. Use absolute asset paths

    1. 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. 6. Fallback: HashRouter

    1. 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 us
Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other Netlify errors

All 10 Netlify errors and fixes →