HTTP 404 Not Found — What It Means and How to Fix It

The HTTP 404 Not Found status code indicates that the server could not find the requested resource. This means the client successfully communicated with the server, but the server was unable to locate anything matching the provided URL.

Last updated: 2026-06-11

RECOMMENDED

Essential Reading: Designing Data-Intensive Applications

The system design bible for software engineers. Learn to build reliable, scalable, and maintainable systems.

View on Amazon →
Status Code 404
Name Not Found

Common Causes

  • Typo in the URL (e.g., incorrect path, filename, or domain)
  • The resource has been moved or deleted from the server without a proper redirect
  • Broken internal or external links pointing to a non-existent resource
  • Misconfigured server routing or rewrite rules
  • User attempting to access a private or non-existent page directly

Code Examples to Handle HTTP 404

curl -I https://httpbin.org/status/404

How to Fix It

  1. **Verify the URL:** Double-check the URL for any typos, incorrect capitalization, or missing parts. Ensure it matches the expected path to the resource.
  2. **Check for redirects:** If the resource was moved, ensure a proper 301 (Moved Permanently) or 302 (Found) redirect is in place from the old URL to the new one.
  3. **Inspect server logs:** Review server access logs for the specific request to see if the server registered the request and what path it was trying to resolve.
  4. **Examine server configuration:** For web servers like Apache or Nginx, check configuration files (.htaccess, virtual host configs) for incorrect rewrite rules or missing file paths.
  5. **Confirm resource existence:** On the server, verify that the file or resource corresponding to the URL actually exists at the specified location and has correct permissions.
💡 Example: A user tries to access `www.example.com/products/old-item.html`, but the 'old-item.html' page was removed last week and no redirect was set up. The server responds with a 404 Not Found.
🛠️ Developer Tip: When encountering a 404, always start by meticulously checking the requested URL. Implement robust error handling and consider custom 404 pages to improve user experience.

Related Status Codes

Frequently Asked Questions

What causes HTTP 404?

HTTP 404 is primarily caused by the requested resource not being found on the server. This often stems from incorrect URLs (typos), resources being moved or deleted without redirects, or server-side configuration issues.

How do I fix HTTP 404?

To fix a 404, first verify the URL for accuracy. If you control the server, check if the resource exists at the specified path, inspect server logs for clues, and review server configuration for routing or rewrite rule errors. Implement 301 redirects for moved content.