Bolt.new site on Netlify: "Page not found" fix
Bolt.new site on Netlify shows "Page not found. Looks like you've followed a broken link"? Check the publish directory, index.html, SSR adapter and redirects.
The Liite team8 دقيقة قراءة
Short answer
Netlify is serving a folder with no index.html at its top level. Run the build locally, find the folder that holds index.html (often dist), and set that as the publish directory under Project configuration > Developer settings > Continuous deployment > Build settings. Then trigger a new deploy and check the file list in the deploy.
Your Bolt.new project deployed to Netlify with no build error, but the live site shows Netlify's 404 page instead of your app:
Page not found. Looks like you've followed a broken link or entered a URL that doesn't exist on this site.
Why Netlify shows this 404 after a green deploy
A successful deploy means Netlify ran a build and published a folder. It does not check that the folder has a page for the URL you open. Netlify's own troubleshooting guide says Netlify requires some kind of index.html file to be present in the publish directory to serve a project. The same guide lists an incorrect or missing publish directory as a separate cause.
Netlify's docs also state that only files in the publish directory are deployed. Anything outside it never goes live.
People on Netlify's support forum have reported this exact error with a Bolt.new project. In one Astro case the build deployed, but the file Netlify expected wasn't in the output, and the reply was to ask Bolt's AI for help. We can't tell whether that thread was fully resolved, so treat the causes below as the usual ones, not a confirmed diagnosis for your project.
Most common causes, first:
- Wrong publish directory. Your framework writes to one folder and Netlify publishes another, or the field is blank.
- Wrong base directory. The app sits in a subfolder, but the build runs from the repository root. Netlify's docs say the publish directory is relative to the base directory, which is root by default.
- Server-rendered output. The project uses an SSR adapter, so the build doesn't produce a plain static site.
- SPA deep links.
/works, but other paths 404 on refresh or direct visit. - Empty or failed build output. The build command didn't produce what you expected.
| Symptom | Likely cause | Fix |
|---|---|---|
/ shows 404, deploy has few or no files | Wrong or blank publish directory | Set it to the folder that holds index.html |
/ shows 404, files are listed | No index.html at the top level, or it's one folder deeper | Fix the publish path or the build output |
/ works, /about 404s on refresh | SPA routing | Add a /* /index.html 200 rewrite |
| 404 on every URL, SSR adapter in use | Output is not static | Use static output, or deploy the way the adapter expects |
| Build runs but output is in a subfolder | Base directory unset | Set the base directory |
Step-by-step fixes
1. See what Netlify actually deployed
Netlify's guide points to the Deploy File Explorer for this.
- Open your project and choose Deploys in the left sidebar.
- Select your latest published production deploy.
- Under Deploy summary, review the file structure in Deploy File Explorer.
- Look for
index.htmlat the top level of the list.
If index.html is missing or buried in a subfolder, the publish directory is wrong. If the explorer is nearly empty, the build output is the problem.
2. Find out where your build writes its files
- Download or sync your project from Bolt.new.
- Run the build on your machine, usually
npm run build. - Open the folder it creates and confirm
index.htmlsits directly inside it.
Netlify's framework list gives typical defaults. For Astro the build command is astro build and the publish directory is dist. Vite also uses dist, Create React App uses build, and Eleventy uses _site. Bolt projects vary, so trust your local build over this list.
3. Set the publish directory to match
- In Netlify, go to Project configuration > Developer settings > Continuous deployment > Build settings.
- Set the build command (for example
npm run build) and the publish directory (for exampledist). - Save, then start a new deploy from the Deploys page.
You can also set it in a netlify.toml file at the project root:
[build]
command = "npm run build"
publish = "dist"File settings win
If a netlify.toml exists in your project, its values override what you type in the Netlify UI. If your UI change seems to be ignored, check that file first.
4. Set the base directory if the app is in a subfolder
If your repository holds the app in a subfolder, set the base directory in the same Build settings screen. Netlify uses it as the place to install dependencies and run the build, and the publish directory is read relative to it.
5. Check for a server adapter
If the project uses an SSR adapter (Astro with a server adapter is one example), the build may not produce a plain static site. Either switch the framework config to static output, or deploy it the way that adapter documents. Which setting does this depends on your framework and version, so check that framework's own docs rather than guessing a config key.
6. Add the SPA rewrite if only deep links fail
If / loads but a refresh on /about gives the 404, you have a routing problem, not an empty root. Netlify's guide says a single-page app may need a rule in the _redirects file:
/* /index.html 200Netlify's docs explain that a 200 status makes this a rewrite, so the visitor's address bar keeps the same URL. Put _redirects in the folder that gets published (for Vite and Astro, usually the public folder, so it is copied into the build output). If you use netlify.toml instead, the equivalent is:
[[redirects]]
from = "/*"
to = "/index.html"
status = 2007. Redeploy and re-check
Start a fresh deploy after any settings change and reload the Deploy File Explorer. If Netlify offers to clear the cache for the deploy, use it. Reloading the page alone changes nothing, because the 404 comes from Netlify's server.
Manual option: drag the built folder
If you'd rather skip Git settings, Netlify's docs say you can drag your project's build or output folder, which may be called dist, build or public, into the deploy zone. Netlify's start guide also covers downloading a Bolt project's files and publishing them this way.
What won't help
- Re-running the same deploy. With no settings change you get the same output.
- Clearing your browser cache. The response is Netlify's, not your browser's.
- Adding a custom domain. It points at the same published folder.
- Renaming pages in your app code. If the build output has no
index.html, source names don't matter.
Checklist before you try again
- The local build finishes and the output folder contains
index.htmlat its top level. - Netlify's publish directory matches that folder name exactly.
- The base directory points at the app if it's in a subfolder.
- No
netlify.tomloverrides the values you set in the UI. - The build is static, not SSR-only.
- The new deploy's file explorer lists your files.
If nothing works
Ask Netlify Support, or post in Netlify's support forum, with the deploy details. Include the site name, the deploy ID or URL, the exact 404 text, your framework and the build command and publish directory you use. Attach the end of the deploy log and a screenshot of the file explorer. Tell them whether / or only deep links fail.
Hi, my site [site-name] deploys successfully but every URL shows "Page not found. Looks like you've followed a broken link or entered a URL that doesn't exist on this site."
Project: built in Bolt.new, framework: [Astro/Vite/other]
Build command: [npm run build], publish directory: [dist], base directory: [none]
Latest deploy: [deploy URL or ID], time: [timestamp]
Deploy File Explorer shows: [index.html at top level / not present / few files]
I already checked the publish directory against my local build and redeployed. Can you confirm what Netlify sees in the deploy?Check your built folder somewhere else
If your build produces plain static files, you can test the finished folder outside Netlify. Liite's uploaded sites accept a folder, a .zip or a single .html file and serve it at a <slug>.liite.site address. A single wrapper folder is stripped automatically, so dist/index.html inside a zip still works. This can show you quickly whether the output itself is fine. Liite doesn't run builds or server-side code, so it only works for output that is already static. Free uploaded sites are limited to 3 MB, go offline 7 days after the last publish, and need a card on file. Details are in the uploaded sites docs.
Common questions
How do I know the publish folder is wrong and not something else?
Open the Deploy File Explorer. Few or no files, or index.html one level too deep, points at the publish directory or build. If index.html sits at the top and / still 404s, check for a netlify.toml override and for SSR output.
Does Bolt.new always produce a static site?
Not necessarily. It depends on the framework and config in your project, so check what your own build writes out instead of assuming.
Why does only a refresh on a sub-page show the 404?
That's a single-page app routing issue. The server has no file for /about, so you need the /* /index.html 200 rewrite from step 6.
Do I need to change my Bolt project or just Netlify's settings?
Usually Netlify's settings are enough. Change the project only if it produces server-rendered output that a static publish can't serve.