HTTP status codes / 404
404 Not Found — HTTP Status Code
404 Not Found means the server found nothing at the requested URL, or chose not to reveal that something is there. It does not say whether the absence is temporary or permanent. One 404 on an old link is routine, but a 404 on your home page or a key route usually means a broken deploy or server configuration.
What 404 means
RFC 9110 (Section 15.5.5) defines 404 Not Found as the origin server not finding a current representation for the target resource, or not being willing to disclose that one exists. It deliberately says nothing about permanence. If the server knows a resource is permanently gone, the RFC prefers 410 Gone.
That second clause matters: a 404 can be a polite cover for "forbidden." Some apps and storage services return 404 for private resources so outsiders cannot discover what exists.
When you see it
- Web servers return 404 when no file matches the path under the document root.
- Application routers return 404 when no route matches, or when a route matches but the record does not exist, such as
/users/999. - CDNs and object storage return 404 for keys that are not in the bucket.
- Reverse proxies pass through the 404 their upstream sends, which is why a proxy pointed at the wrong backend can return 404 for everything.
Common causes
- Wrong document root after a deploy. A release directory changed, a symlink such as
currentpoints to an old or empty folder, or the build output moved frombuild/todist/. - Routing changes. A renamed route or a removed controller without a redirect from the old path.
- Trailing slash mismatches.
/pricingand/pricing/are different URLs. Some servers and frameworks redirect one to the other; others serve one and 404 the other. - Case sensitivity.
/Aboutand/aboutare the same file on macOS and Windows file systems but different on Linux servers. - Single-page apps without a fallback, so deep links 404 on a hard refresh.
- Virtual host mix-ups, where a request lands on the default server block instead of yours.
How to fix it
Check the server's access and error logs for the exact path requested and the file it tried to open. nginx logs lines like open() "/var/www/html/pricing" failed (2: No such file or directory), which tells you both the path and the root it used.
Confirm the document root points at the current build:
server {
server_name example.com;
root /var/www/example/current/dist;
location / {
try_files $uri $uri/ /index.html; # SPA fallback
}
}
Drop the /index.html fallback for traditional sites, otherwise every missing page returns your home page with a 200.
Make trailing slashes consistent with a single redirect rule, for example removing them in nginx:
rewrite ^/(.*)/$ /$1 permanent;
When you rename or move pages, add 301 redirects from the old URLs.
Avoid soft 404s
A custom "Page not found" template must still send a 404 status. In Express:
app.use((req, res) => {
res.status(404).render("not-found");
});
Without status(404) the page returns 200, search engines may index it, and status-based monitoring cannot tell it from a real page.
How to check it
curl -sS -o /dev/null -w "%{http_code} %{url_effective}\n" -L https://example.com/pricing
The -L flag follows redirects, so you see the final status and URL. Run it with and without a trailing slash to spot inconsistencies.
What it means for uptime monitoring
PingRobot's checker sends a GET with the user agent PingRobot/1.0 (+https://pingrobot.io/bot), follows redirects, and counts the final response as up only if its status is between 200 and 399. A 404 is reported as down.
On a monitored URL that worked before, a 404 is usually a real outage: the deploy shipped to the wrong folder, the routes are missing, or the proxy points at the wrong backend. Visitors are getting the same result, and the alert deserves attention.
It is a monitor problem only if the URL was wrong to begin with, or if you intentionally removed the page. Then update or delete the monitor.
The reverse trap is the soft 404: a broken site that answers every path with a 200 error page looks healthy to a status check. If that is a risk for your site, a keyword monitor that looks for text only present on the real page catches it.
Related codes
- 410 Gone for intentionally removed content
- 301 Moved Permanently for pages that moved
- 403 Forbidden when access is refused rather than missing
- 405 Method Not Allowed when the URL exists but not for that method
- 400 Bad Request for malformed requests
Start monitoring free — 10 monitors, no credit card.
Frequently asked questions
What is a soft 404?
A soft 404 is a page that tells the visitor the content does not exist but returns a 200 status code. Search engines may flag it, and status-only monitors will report the page as up even though it is effectively missing.
Should I redirect all 404s to the home page?
No. Redirecting every missing URL to the home page confuses visitors and search engines, which often treat it as a soft 404. Redirect only URLs that have a genuine replacement and let the rest return 404.
Why does my single-page app return 404 when I refresh a page?
The browser asks the server for a path like /settings, but the server only has index.html. Configure the server to fall back to index.html for unknown paths so the client-side router can take over.
When should I use 410 instead of 404?
Use 410 Gone when you removed something on purpose and it is not coming back. Use 404 when you do not know, or when the absence might be temporary.