What is a 404 error? What it means and how to fix it
Kofi Agyem, Founder and CEO, CloudzyroPublished · 6 min read
On this page
A 404 Not Found means the server is up but can't find the page you asked for. Why it happens, how to fix one as a visitor or site owner, and SEO effects.
1. The short answer
A 404 error, or "404 Not Found", means your browser reached the website's server, but the server couldn't find the page you asked for. The site itself is working; that one address isn't. It usually happens because a page was moved or deleted, a link is wrong, or the address was mistyped.
404 is an HTTP status code, a three-digit number a web server sends with every response. Codes in the 400s mean the problem is with the request (like asking for a page that doesn't exist); codes in the 500s, like a 502 Bad Gateway, mean the server failed.
2. What you'll see
It can look like a plain "404 Not Found", a branded page saying "Page not found", or a browser message. However it's dressed up, the status code underneath is the same. You can see it in your browser's developer tools (Network tab) or with curl (below).
3. Common causes
- A typo in the address. One wrong letter, a missing hyphen or an extra slash.
- The page moved without a redirect. A redesign changed
/about-usto/about, and old links still use the first. - The page was deleted. A product sold out, a post was unpublished.
- A broken link on your own site or someone else's.
- Case sensitivity. Many servers treat
/Menu.htmland/menu.htmlas different files. - A missing file in a deploy. An image or page wasn't included in the upload, or the build put it somewhere else.
- Single-page app routes. In React or Vue apps, the browser handles
/dashboard, but loading it directly asks the server for a file that doesn't exist. - The wrong folder. The site was uploaded one folder too deep, so every page is at
/site/pageinstead of/page.
4. How to fix a 404 as a visitor
- Check the address for typos and try again.
- Remove the end of the address, one part at a time, to go up a level (from
/blog/2024/my-postto/blog). - Use the site's own search or menu.
- Search for the page's title in a search engine.
- Try the Internet Archive's Wayback Machine for an old copy.
- Tell the site owner, especially if their own link is broken.
5. How to fix 404s on your own site
- Moved pages: add a permanent (301) redirect from the old address to the new one. This keeps visitors, bookmarks and search rankings.
- Deleted pages: if there's a close replacement, redirect to it. If not, let it return 404 (or 410 if it's gone for good). Don't redirect everything to the home page.
- Broken internal links: fix the link itself rather than relying on a redirect.
- Missing files after a deploy: check the build output contains them, at the paths you expect, with the same capitalization.
- Single-page apps: set the server to return
index.htmlfor unknown paths, or prerender those routes, so refreshing a page doesn't 404. Your framework's deployment docs usually cover this. - A good 404 page: keep your site's header and menu, say plainly that the page isn't there, and offer search and links to popular pages. Make sure it still returns the 404 status code.
On Cloudzyro Sites & Apps, every deploy is kept as a version you can download or restore in one click, so if a release removed pages by mistake, restoring the previous version brings them back while you fix it.
6. A worked example
A café redesigns its site. The old menu page was /our-menu.html; the new one is /menu. A week later, the owner notices people still arriving at the old address from a local directory listing and getting 404s.
- She checks the old address with
curl -I https://www.example.com/our-menu.htmland sees404. - She adds a permanent redirect from
/our-menu.htmlto/menuin the site's configuration (in Next.js,redirects()innext.config.js; on cPanel hosting, a rule in.htaccess). - She deploys and checks again: now it's
301(or308) withlocation: /menu. - She asks the directory to update its link too, but with the redirect in place it no longer matters if they don't.
7. Other 4xx errors you might see
- 400 Bad Request: the server couldn't understand the request, often a malformed address or a broken cookie.
- 401 Unauthorized: you need to sign in.
- 403 Forbidden: the server understood, but you're not allowed to see it. Some sites return 404 instead of 403 so they don't reveal that a private page exists.
- 410 Gone: the page was removed on purpose and won't come back.
- 429 Too Many Requests: you've sent too many requests in a short time. Wait and try again.
8. 404s and SEO
Google says 404s are a normal part of the web and don't harm a site's rankings on their own. Missing pages eventually drop out of search results. Two things are worth your time:
- Redirect pages that mattered. A page that had traffic or links from other sites should redirect to its closest replacement, so that value isn't lost.
- Avoid soft 404s. A "not found" page that returns
200 OK, or a redirect of everything to the home page, gets flagged as a soft 404 in Google Search Console. Return a real 404 status.
Google Search Console's Pages report lists URLs it found returning 404, which is a good place to spot broken links you didn't know about.
9. How to check a page's status code
# Show just the headers, including the status code
curl -I https://www.example.com/some-page
# Follow redirects and show each step
curl -IL https://www.example.com/old-pageThe first line tells you the answer: HTTP/2 404 means not found, HTTP/2 200 means it's there, and 301 or 308 means it redirects (the location: header says where). In a browser, open developer tools, go to the Network tab and reload: the Status column shows the code.
If your whole site, not just one page, fails on a custom domain, it's probably DNS rather than a missing page. See What is DNS? and Domain not working. If a new version didn't go live at all, see Fix a failed deploy.