Fixes · Deploys that break

Pages show 404 when refreshed or opened directly

Your Lovable or Bolt app works from the home page, but /dashboard shows 404 on Vercel or Netlify when you refresh it or open a link to it. One small file fixes it.

Most common in apps built with Lovable, Bolt.

What you see

The home page loads. Clicking around works. But refresh /dashboard, or open a link someone shared to it, and the host answers 404 NOT_FOUND.

Why it happens

The app is a single-page app: its pages exist only in the browser, drawn by a router (React Router, Wouter). The host is asked for a file called /dashboard, has none, and says so. Inside Lovable or Bolt, their hosting sends every address to the app for you.

How to fix it

  1. On Vercel, add a file named vercel.json at the top of the repository with: { "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }] }
  2. On Netlify, add public/_redirects with the line: /* /index.html 200
  3. On Cloudflare Pages, you need nothing: it sends unknown addresses to the app by itself.
  4. Commit, push, and open a deep link again.

Or ask your AI tool to fix it

Paste this into Lovable, Bolt, v0, Replit or Cursor, and let it make the change.

My app shows 404 when a page other than the home page is refreshed or opened directly on Vercel. Add a vercel.json at the root of the repository that rewrites every path to /index.html, so the router handles it. Don't change anything else.

Don't change what the app does.
Never put a secret key or password in the code: read it from an environment variable.
If a step has to be done outside the code, like revoking a key in a provider's dashboard, list it for me at the end instead of skipping it.

How Launchpad helps

The launch check flags it before you deploy, and the console's import wizard hands you the vercel.json, or hosts the app on Cloudflare Pages, which needs none.

Check your app for this, freeJoin the waitlist

Related