Netlify Site Shows "Page Not Found" After Upload? Check Your index.html

5 min read
On this page

You upload your site, the deploy says it's published, and the address shows Netlify's "Page not found" page. The deploy didn't fail. Netlify published your files, but it can't find a home page among them.

When someone opens your site's address, Netlify looks for a file named index.html at the top level of what you published. If it isn't there, visitors get the 404 page.

So the first step is to look at what you published. You can do that in the Netlify dashboard or in Netli.fyi, and both are described at the end of this post. Then find your case below.

index.html is one folder too deep#

This is the most common cause. When you drag a folder onto Netlify Drop, the folder you drop becomes the top level of your site, so index.html must be directly inside it. If it's one level deeper, for example in my-site/website/index.html or my-site/dist/index.html, your home page ends up at /website/index.html and the top level has no index.html.

To check, open the address with the inner folder name added, for example https://your-site.netlify.app/website/. If your site appears there, this is the problem.

To fix it, drop the folder that holds index.html. If your project has a build step, that's the build output folder, such as dist or build, and not the project folder.

The same rule applies to a zip file. When you open the zip, index.html should be the first thing you see, with no folder around it. To make a zip like that, open the folder that holds index.html, select everything inside it, and compress the selection.

The home page has a different name#

Netlify only looks for index.html. A home page named home.html, main.html or index.htm isn't found. Rename it to index.html.

Check the capital letters too. Use index.html in lowercase, not Index.html. Your computer may treat them as the same name, but Netlify's builds and redirect rules are case-sensitive.

The publish directory is wrong#

If your project builds from Git, Netlify publishes one folder from the build output. This is the Publish directory in the project's build settings. If it points at the wrong folder, the deploy succeeds and publishes the wrong files.

Different tools write their output to different folders:

ToolUsual publish directory
Vite, Astro, Vue, Nuxtdist
Create React App, SvelteKitbuild
Next.js static exportout
Gatsby, Hugopublic
Eleventy_site
Angulardist/<project name>
Plain HTML with no buildThe folder that holds index.html, often .

The publish directory is in the project's Build settings. If your repository has a netlify.toml file with a publish value, that value wins over the dashboard.

To check, look at the deploy's files, in Netlify or in Netli.fyi. If you see index.html at the top, the publish directory is right. If you see your source code, such as src and package.json, it's wrong.

Only some pages show "Page not found"#

If the home page works but other addresses don't, there are two usual causes.

The link points to a file that doesn't exist. Check the spelling and the capital letters of the file name, and check that the file was in the upload.

The site is a single-page app (React, Vue or similar) and the page breaks when you reload it. The app handles its routes in the browser, but when you reload /about, Netlify looks for a file at /about and doesn't find one. Add a file named _redirects to your publish directory with this line:

/*    /index.html   200

This sends every address to index.html, and your app shows the right page. For more about this file, see Netlify redirects.

How to see what you published#

In the Netlify dashboard#

Open the project, go to Deploys, and open the latest deploy. The Deploy File Explorer lists the files of that deploy. index.html should be at the top of the list, not inside a folder.

In Netli.fyi#

Open the project, tap the latest deploy under Latest deploys, then tap Browse files. Folders come first, then the files at the top level. Find index.html among the files after the folders.

Netli.fyi Deployed files screen listing the folders about, apartments, assets and images, then the top-level files _redirects, 404.html, favicon.ico, index.html and robots.txt
Deploy → Browse files: index.html is at the top level, next to the folders

If index.html is only inside a folder, such as website/index.html, you have the first problem in this post. If you see src and package.json, you have the publish directory problem. You can also tap a file to save it to your phone and open it.

When you've fixed the files, publish again:

  • Uploaded with Netlify Drop: in Netlify, open the project's Deploys and drag the fixed folder onto it. In Netli.fyi, open the project and tap Upload to send a zip or a single HTML file from your phone. Put index.html at the top of the zip.
  • Built from Git: fix the publish directory, then start a new deploy. In Netlify, use Trigger deploy in the project's Deploys. In Netli.fyi, open the project and tap Deploy.

Related: How to deploy to Netlify · Download the files of a deployed Netlify site · How to fix common Netlify build errors

Share:
Perttu Lähteenlahti

Written by

Perttu Lähteenlahti

Developer Advocate at RevenueCat and creator of Netli.fyi. Building on Netlify since 2019 and writing from hands-on experience deploying dozens of production sites.

More about the author