Bolt.new app shows 404 when you refresh a page? Here’s why
Your Bolt.new app is live. You click around and everything works. Then you refresh on /dashboard, or someone opens a link you shared, and they get a “Page not found” screen or a bare 404.
Nothing is wrong with your code. It’s a mismatch between how your app handles URLs and how the server does.
Why it happens
Most Bolt projects are single-page apps (SPAs): Vite + React with React Router. The build contains one real page, index.html, plus JavaScript. When you click a link inside the app, React Router changes the address bar and swaps the view without asking the server for anything.
A refresh is different. The browser asks the server for /dashboard. The server looks for a file called dashboard or dashboard/index.html, doesn’t find one, and returns 404. Your app never gets a chance to load and handle the route.
The fix is to tell the host: “for any path that isn’t a real file, serve index.html and let the app decide.” That’s called an SPA fallback or rewrite.
First: which host is your app on?
According to Bolt’s Netlify docs (checked October 19, 2026), new Bolt projects publish to Bolt hosting by default (a .bolt.host URL). Netlify is an optional hosting provider you can choose under Domains & Hosting after connecting a Netlify account. Older projects may still be on Netlify if they were published before Bolt hosting shipped (August 14, 2025) or if you switched intentionally.
Check the URL you’re refreshing: .bolt.host means Bolt hosting; .netlify.app (or a custom domain managed in Netlify) means Netlify. The SPA rule below is for Netlify and other static hosts. On Bolt hosting, if refresh still 404s, tell Bolt in the project chat that deep links return 404, or publish to Netlify/Vercel with the rewrite below.
On Netlify (optional Bolt publish target)
Netlify documents this exact rule for single-page apps. Create a file called _redirects in your project’s public/ folder (Vite copies public/ into dist/ during the build) containing one line:
/* /index.html 200
The 200 matters: it makes this a rewrite, so the URL stays /dashboard while Netlify serves index.html behind the scenes. Real files still win. Netlify won’t rewrite a URL that matches an existing file, so your JavaScript, images and robots.txt keep working.
You can put the same rule in netlify.toml instead, and many Bolt projects already have one. If yours does and you still get 404s, check where the file actually ends up. Netlify’s forum has a Bolt-specific thread where Netlify staff explain that Bolt uploaded already-built files instead of running a Netlify build, much like a drag-and-drop deploy. In that setup a netlify.toml in the repo root can be ignored, while a _redirects file inside the published folder still gets picked up. That’s why the public/_redirects route tends to be the more robust choice.
On Vercel
Vercel uses a vercel.json in the project root:
{
"rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}
Static files are served first, so assets aren’t affected.
Not sure which of these is your problem? The free health check looks at your live app in seconds, or request a free scan and we’ll tell you what we find.
Other hosts
- Cloudflare Pages: SPAs without a top-level
404.htmlget the fallback by default; a_redirectsfile works too. - Nginx:
try_files $uri $uri/ /index.html;in thelocation /block. - S3/CloudFront and similar: configure a custom error response that returns
index.htmlwith status 200. Don’t rely on a storage-level error page, because those return status 404 even when the page renders.
Gotchas after you add the rule
“It still 404s”
Confirm the rule is actually deployed. On Netlify, open the deploy and look in the Deploy File Explorer for _redirects at the top level of the published files. If it’s missing, it was in the wrong folder.
Your real 404 page disappears
With a catch-all rewrite, every unknown URL returns your app with status 200. Add a catch-all route in React Router (path="*") that renders a friendly “not found” screen so users aren’t left on a blank layout.
API routes stop working
If you proxy /api/* to a backend or to Netlify Functions, those rules must come before the catch-all line. Rules are matched top to bottom.
Blank page instead of 404
If refresh now gives a white page instead of a 404, the rewrite works but the app crashes on load, usually from missing environment variables or relative asset paths. Our blank-screen guide covers those, and they apply to Bolt apps too.
Why AI tools keep missing this
Inside the Bolt preview, a dev server handles every route, so the bug never appears while you build. It only shows up on a static host, after you’ve shipped. It’s a deployment detail, not a code detail, so it’s easy for an AI assistant to skip unless you ask for it.
Checklist
- Know your host (Bolt hosting, Netlify, Vercel, Cloudflare, other)
- SPA fallback rule added in the right place for that host
- Rule confirmed in the deployed files
- API and proxy rules placed above the catch-all
- In-app “not found” route for unknown paths
Stuck? Get a free scan of your app
Send us your repo and a one-line description of what’s broken. We’ll email you the top issues we find and why they matter. If you’d rather not touch it yourself, the $199 Fix covers up to 5 issues, delivered as a pull request with tests — not fixed, full refund.
FAQ
Why does my Bolt.new app 404 when I refresh a page?
Most Bolt apps are single-page apps. On refresh the browser asks the server for a file like /dashboard, which doesn’t exist, so the server returns 404 before your app can load.
Is Netlify Bolt’s default host?
No. New Bolt projects publish to Bolt hosting (.bolt.host) by default. Netlify is an optional provider you connect under Domains & Hosting.
Why does it work in the Bolt preview?
In the preview a dev server handles every route, so the problem only appears on a static host after you ship.
What fixes it on Netlify?
An SPA fallback rewrite: put /* /index.html 200 in public/_redirects so Vite copies it into the published folder. Other hosts have their own equivalent.
I added the rule and it still 404s. Why?
The rule probably isn’t in the deployed files. On Netlify, check the Deploy File Explorer for _redirects at the top level of the published folder.
Related guides
- Lovable app shows a blank white screen after deploy? Here’s why
- Your Lovable app freezes or goes blank right after login: here’s why
- Google login sends users to localhost after you publish? Here’s the fix
Launching soon? Run through our launch checklist for AI-built apps: 14 checks, each linked to the full guide.