Start watching free

Error library · A 404 on refresh

404 when you refresh the page or open a link directly

Your app works when you click around it. Then someone refreshes, or opens a link you shared, and gets “404 Not Found”.

Why it happens

Your app is one page that draws every screen itself. Clicking a link inside it never asks the server for /dashboard. Refreshing does, and the server has no file by that name. The builder’s preview answers every address with your app. Your own host has to be told to do the same.

Check it in a minute

  1. Open your live app and click through to any inner page.
  2. Press refresh.
  3. If your host’s “404” appears instead of your app, this is it.

How to fix it

Give this to the AI that builds your app: Lovable, Bolt, Cursor, Claude Code or any other.

My app is a single-page app. On the live site, refreshing an inner page such as /dashboard, or opening its link directly, returns a 404 from the host. Navigating inside the app works.

Add the rewrite rule for my host so that every path that is not a real file serves index.html:
- Vercel: a rewrite in vercel.json
- Netlify: a "/* /index.html 200" line in public/_redirects
- Firebase Hosting: a rewrite to /index.html in firebase.json
- Cloudflare Pages: a _redirects file, or its single-page-app setting

Tell me which host you found and which file you changed. Do not change the app's routes. After the fix, refreshing any inner page must load that page.

What Vigilia sees of this

  • With a key page set (paid plans): Vigilia opens each one every minute, straight from its address, the way a visitor with a shared link does. A 404 becomes an incident within minutes.
  • Requests your app makes that come back 404 are recorded from the first visitor and raised once three different visitors hit them.

What it can’t see: The host’s 404 page is not your app, so the Vigilia script is not on it. Without a key page, a refresh that lands on the host’s 404 throws no error Vigilia can see.

Know before your users tell you

Vigilia watches your live app, explains what breaks in plain language, hands your AI the fix, and confirms it held with real visitors.

More from the error library