[Support Guide] I’ve deployed my site but I still see "Page not found”

Hi!
I recently just deployed my site (built with React JS), which is https://todoapp-task.netlify.app/

When I visit the app, it redirected me to https://todoapp-task.netlify.app/welcome (because users’ need to login to access this page, if user’s haven’t logged in, it will be redirected to https://todoapp-task.netlify.app/welcome). Unfortunately, It shows up 404 Error Page, but it works fine when I run it in local machine.

Hi, @stanleyowen. I’m 99% sure you just need a single-page app (SPA) rule as found in our documentation here:

https://docs.netlify.com/routing/redirects/rewrites-proxies/#history-pushstate-and-single-page-apps

If creating that rule doesn’t fix this or if there are other questions, please let us know.

Thanks @luke! It works and it saved my times a lot

Hi -

I’m trying to deploy an Angular App that host in a submodule repository. I followed the steps to set up the Continues Deployment defining a base directory “frontend” where the app projects are located. After running the deploy it looks like the build success but when hitting the url I got a “Page not found”.
Url: https://jovial-bose-e913aa.netlify.app

Any help will be appreciated.
Thank you

See log below:

12:05:09 PM: Build ready to start
12:05:11 PM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
12:05:11 PM: build-image tag: v3.6.1
12:05:11 PM: buildbot version: 44655717ddf0e7bd7f856f5b1154254de54b1d80
12:05:11 PM: Building without cache
12:05:11 PM: Starting to prepare the repo for build
12:05:11 PM: No cached dependencies found. Cloning fresh repo
12:05:11 PM: git clone GitHub - ogm710811/angular11-workspaces-multi-app-projects
12:05:12 PM: Preparing Git Reference refs/heads/main
12:05:14 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘frontend/projects’ versus ‘projects/’ in the Netlify UI
12:05:14 PM: Starting build script
12:05:14 PM: Installing dependencies
12:05:14 PM: Python version set to 2.7
12:05:16 PM: v12.18.0 is already installed.
12:05:17 PM: Now using node v12.18.0 (npm v6.14.4)
12:05:17 PM: Started restoring cached build plugins
12:05:17 PM: Finished restoring cached build plugins
12:05:17 PM: Attempting ruby version 2.7.1, read from environment
12:05:19 PM: Using ruby version 2.7.1
12:05:19 PM: Using PHP version 5.6
12:05:19 PM: Started restoring cached node modules
12:05:19 PM: Finished restoring cached node modules
12:05:19 PM: Installing NPM modules using NPM version 6.14.4
12:06:00 PM: > core-js@3.6.5 postinstall /opt/build/repo/frontend/node_modules/core-js
12:06:00 PM: > node -e “try{require(‘./postinstall’)}catch(e){}”
12:06:01 PM: > @angular/cli@11.0.6 postinstall /opt/build/repo/frontend/node_modules/@angular/cli
12:06:01 PM: > node ./bin/postinstall/script.js
12:06:03 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
12:06:03 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
12:06:03 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
12:06:03 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
12:06:03 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/rollup/node_modules/fsevents):
12:06:03 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
12:06:03 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.1 (node_modules/fsevents):
12:06:03 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
12:06:03 PM: added 1533 packages from 1256 contributors and audited 1540 packages in 43.086s
12:06:05 PM: 84 packages are looking for funding
12:06:05 PM: run npm fund for details
12:06:05 PM: found 0 vulnerabilities
12:06:05 PM: NPM modules installed
12:06:05 PM: Started restoring cached go cache
12:06:05 PM: Finished restoring cached go cache
12:06:05 PM: go version go1.14.4 linux/amd64
12:06:05 PM: go version go1.14.4 linux/amd64
12:06:05 PM: Installing missing commands
12:06:05 PM: Verify run directory
12:06:07 PM: ​
12:06:07 PM: ────────────────────────────────────────────────────────────────
12:06:07 PM: Netlify Build
12:06:07 PM: ────────────────────────────────────────────────────────────────
12:06:07 PM: ​
12:06:07 PM: ❯ Version
12:06:07 PM: @netlify/build 8.3.0
12:06:07 PM: ​
12:06:07 PM: ❯ Flags
12:06:07 PM: deployId: 60119d4526a1e77ab6ff90c2
12:06:07 PM: mode: buildbot
12:06:07 PM: ​
12:06:07 PM: ❯ Current directory
12:06:07 PM: /opt/build/repo/frontend
12:06:07 PM: ​
12:06:07 PM: ❯ Config file
12:06:07 PM: No config file was defined: using default values.
12:06:07 PM: ​
12:06:07 PM: ❯ Context
12:06:07 PM: production
12:06:07 PM: ​
12:06:07 PM: ────────────────────────────────────────────────────────────────
12:06:07 PM: 1. Build command from Netlify app
12:06:07 PM: ────────────────────────────────────────────────────────────────
12:06:07 PM: ​
12:06:07 PM: $ ng build
12:06:15 PM: Compiling @angular/core : es2015 as esm2015
12:06:21 PM: Compiling @angular/common : es2015 as esm2015
12:06:22 PM: Compiling @angular/platform-browser : es2015 as esm2015
12:06:22 PM: Compiling @angular/router : es2015 as esm2015
12:06:23 PM: Compiling @angular/platform-browser-dynamic : es2015 as esm2015
12:06:27 PM: - Generating browser application bundles…
12:06:48 PM: :heavy_check_mark: Browser application bundle generation complete.
12:06:49 PM: - Copying assets…
12:06:49 PM: :heavy_check_mark: Copying assets complete.
12:06:49 PM: - Generating index html…
12:06:49 PM: :heavy_check_mark: Index html generation complete.
12:06:49 PM: Initial Chunk Files | Names | Size
12:06:49 PM: vendor.js | vendor | 2.33 MB
12:06:49 PM: styles.css | styles | 366.19 kB
12:06:49 PM: polyfills.js | polyfills | 141.43 kB
12:06:49 PM: scripts.js | scripts | 60.99 kB
12:06:49 PM: main.js | main | 50.31 kB
12:06:49 PM: runtime.js | runtime | 6.15 kB
12:06:49 PM: | Initial Total | 2.94 MB
12:06:49 PM: Build at: 2021-01-27T17:06:49.053Z - Hash: b5aac9d2d43832cb7a8b - Time: 21261ms
12:06:49 PM: ​
12:06:49 PM: (build.command completed in 41.2s)
12:06:49 PM: ​
12:06:49 PM: ────────────────────────────────────────────────────────────────
12:06:49 PM: 2. Deploy site
12:06:49 PM: ────────────────────────────────────────────────────────────────
12:06:49 PM: ​
12:06:49 PM: Starting to deploy site from ‘frontend/projects’
12:06:49 PM: Creating deploy tree
12:06:49 PM: Creating deploy upload records
12:06:49 PM: 0 new files to upload
12:06:49 PM: 0 new functions to upload
12:06:49 PM: Site deploy was successfully initiated
12:06:49 PM: ​
12:06:49 PM: (Deploy site completed in 125ms)
12:06:49 PM: ​
12:06:49 PM: ────────────────────────────────────────────────────────────────
12:06:49 PM: Netlify Build Complete
12:06:49 PM: ────────────────────────────────────────────────────────────────
12:06:49 PM: ​
12:06:49 PM: (Netlify Build completed in 41.5s)
12:06:49 PM: Starting post processing
12:06:49 PM: Post processing - HTML
12:06:49 PM: Caching artifacts
12:06:49 PM: Started saving node modules
12:06:49 PM: Finished saving node modules
12:06:49 PM: Started saving build plugins
12:06:49 PM: Finished saving build plugins
12:06:49 PM: Started saving pip cache
12:06:49 PM: Post processing - header rules
12:06:49 PM: Post processing - redirect rules
12:06:49 PM: Post processing done
12:06:49 PM: Finished saving pip cache
12:06:49 PM: Started saving emacs cask dependencies
12:06:49 PM: Finished saving emacs cask dependencies
12:06:49 PM: Started saving maven dependencies
12:06:49 PM: Finished saving maven dependencies
12:06:49 PM: Started saving boot dependencies
12:06:49 PM: Finished saving boot dependencies
12:06:49 PM: Started saving rust rustup cache
12:06:49 PM: Site is live :sparkles:
12:06:49 PM: Finished saving rust rustup cache
12:06:49 PM: Started saving go dependencies
12:06:49 PM: Finished saving go dependencies
12:06:53 PM: Build script success
12:07:22 PM: Finished processing build request in 2m11.388124005s

Hi, @ogarcia. The instructions above say to download the deploy to see if there is an index.html file in the base of the deploy. Did you try that? If so, what did you find?

@luke I downloaded the deploy and found there wasn’t index.html file in there. I found an error on the publish directory path of the deploy settings. It works now. Thank you for your help.

1 Like

I too deployed my site: https://nifty-fermi-373867.netlify.app/ but I am getting the error of page not found. what am I doing wrong?

@Siddharth-asterisk Welcome to the Netlify community. You may be experiencing a local caching issue. Trying clearing your caches, using a different browser, etc. This is what I’m seeing.

Screen Shot 2021-01-28 at 10.35.07 AM

Hi i am trying to deploy my webise but its keep showing me page not found .
https://hotelzay.netlify.app

@sarab-jot Welcome to the Netlify community.

Do you have an index.html file at the top level of your website file hierarchy?

Hi, @sarab-jot. If you download your deploy as suggested in the support guide, you will see that your files are all contained in a subdirectory named “new version” (with a space). Because spaces are not allowed in URLs, this makes the working URL for this deployed site the following one:

https://hotelzay.netlify.app/new%20version/

If you stop nesting the site in that directory, that will make the site available at the URL without a path. If there are other questions or concerns, please let us know.

My index works fine, but my one other page (/react) fails. I’m looking at a branch preview Refcode Community - Volunteer or learn to code

It does work locally, of course. But there’s no error messaging to follow on the branch deploy. :frowning:

Hi, I am having this problem not on my index page (works fine) but on my only other page handled by the router (located at /react). It works locally, but once deployed to a branch preview it gives me a 404.

https://master--refcode.netlify.app/pages/react

SOLVED:

If you are having issues with create react app like I was. Try this:

You need to setup redirects to /index.html for it to work.

Good luck.

8 posts were split to a new topic: Successful deploy but still “Page not found”

I have read through many of the responses here. I have ensured I have index.HTML files, resaved the project into a new repository through GitHub, but I still am having trouble. If someone can please clue me into what is happening, I would appreciate the insight. I am at a complete loss. Thank you.
https://wonderful-shannon-243597.netlify.app/

Hi, @cbruzelius. Your index.html file exists inside of directory named “weather project” (with a space). Spaces are not allowed a part of a URL so percent-encoding is used to replace it with “%20”.

This makes the final URL for the site, the one below:

https://wonderful-shannon-243597.netlify.app/weather%20project/

If there are other questions about this, please let us know.

hi everyone, this thread is getting very long and hard to navigate, so I am going to close it.

If you need further assistance after working through the steps outlined above and in this thread, please start a new post, telling us the name of your site, what you have already tried, and whether or not you have verified that an index.html file is present. thanks!

Last reviewed in August 2021.