Find out why your server can't find the page
404 Not Found means the server has nothing to send for the address requested, or won't say whether it does. For a page you deleted, that's the right answer. When a page you expect to work returns 404, compare the address with what's on the server: a mistyped or outdated link, a page moved without a redirect, a difference in capital letters, a file that never made it into the deploy, or a single-page app with no fallback for deep links.
Why a page you expect returns 404
The link is wrong
A typo in a link, or a link that still points to an old address, sends visitors to a URL that never existed or no longer does.
The page moved without a redirect
Renaming a page or changing a URL pattern leaves every old link and bookmark pointing at nothing, unless each old address redirects to its new one.
Capital letters differ
Everything after the domain name in a URL is case-sensitive by default, so /About and /about can be different pages, and a link with the wrong case can miss a file that exists.
The file isn't where the server looks
The build wrote the page to a different folder, the deploy skipped it, or the server serves from another directory. The address is right, but nothing sits behind it.
A single-page app has no fallback
An app that handles routes in the browser works when you click through from the home page. A direct visit or a reload of an inner address asks the server for a file that doesn't exist, and without a fallback to the app's main page the server answers 404.
MDN names mistyped URLs and pages moved or deleted without a redirect as common causes. RFC 3986 treats every part of a URL after the host as case-sensitive by default, and Angular's deployment guide describes the deep-link 404 and the fallback that fixes it.
Check each version of the address
# Print the status for the address that fails
curl -sI -o /dev/null -w '%{http_code}\n' https://yoursite.com/pricing
# Try the variants links use: letter case, a trailing slash and an old path
for p in /pricing /Pricing /pricing/ /old-pricing; do
printf '%s ' "$p"; curl -sI -o /dev/null -w '%{http_code}\n' "https://yoursite.com$p"
done
Read what the variants return
If one variant returns 200 and the rest return 404, the page exists and some links use the wrong form of its address. Pick one form, redirect the others to it and update your links. If every variant returns 404, the server has no page there at all, so look at the build output and the deploy for the missing file.
If the home page loads but every inner address returns 404 when typed in or reloaded, suspect a single-page app on a static server with no fallback. Set the server to return the app's main page for unknown paths. The server then answers 200 for every address, so the app has to handle the ones it doesn't recognize: Google's JavaScript SEO guide suggests redirecting them with JavaScript to an address that returns 404, or adding a noindex robots tag, so Google doesn't report them as soft 404s.
How to fix a 404 Not Found error
- Bring back a page removed by mistakePut it back at the same address rather than a new one, so the links and bookmarks that already point to it start working again.
- Redirect old addresses to their new pagesUse a permanent redirect, 301 or 308, from each old URL to the page that took its place, and point your own links at the new address so visitors skip the extra hop.
- Fix the links you controlSearch your pages, menus and sitemap for the failing address and change it. You can't edit a link on someone else's site, which is where a redirect earns its keep.
- Keep the 404 status on a helpful pageFor addresses that are gone for good, answer with a 404 status and a page that offers search or links to your main sections. The status tells browsers and crawlers the page is missing, and the page helps the person who landed there.
Frequently asked questions
Why does a page return 404 only after I deploy?
The page exists in your project but not where the server looks. Check the build's output folder for the file, confirm the deploy uploaded it, and compare the letter case of file names with your links, since a link to /About misses about.html on a server that matches case exactly.
Why does the page still show 404 after I fixed it?
A cache may still hold the old answer. RFC 9110 lets caches reuse a 404 for a while when the response sets no cache rules of its own, so a CDN can keep serving it after the page is back. Purge the address from your CDN, and give error responses a short cache lifetime so a fix shows up quickly next time.
What should a custom 404 page include?
A plain message that the page wasn't found, links to the home page and your main sections, and search if your site has it. MDN suggests keeping a playful design in moderation so visitors still understand why they're there. Check that the page returns a 404 status, not 200.
Watch for errors your visitors hit
- Website reliabilityHear about it when your site goes down, not days later from a customer.
- Not found (404)Sort the 404 errors Google reports into the ones to leave alone and the ones to fix.
- Soft 404 errorsGive missing pages an appropriate response instead of a success status with an error message.
- Broken linksRepair dead destinations and connect pages that lack useful internal links.