Skip to main content
AllDevToolsHub
Back to error codes
ERROR 404

Not Found

HTTP Error

The server cannot find the requested resource.

Root Cause

The URL does not exist, the resource was deleted, or the route is not registered.

How to Fix

Check the URL for typos, verify the resource exists, and ensure the route is registered in your application.

Quick Summary

404 means the server cannot find the requested resource. The most common HTTP error. Check the URL, verify the resource exists, and ensure routes are correctly configured.

Key Takeaways

Key Takeaways

  • The resource does not exist at the given URL
  • Could be a deleted resource, wrong URL, or unregistered route
  • Return 404 (not 403) when a resource does not exist to avoid leaking information about protected resources
  • Implement a custom 404 page for better UX
Use Cases

When to use it

  • Accessing a deleted blog post
  • Mistyped URL in a browser
  • API endpoint not registered
Watch out

Common Mistakes

  • Returning 200 with an error body instead of 404, always use the correct HTTP status code
  • Returning 403 for non-existent resources, this leaks information about what exists
FAQ

404 Not Found, Frequently Asked

Should I return 404 or 403 for a resource the user cannot access?

Return 404 if you want to hide the existence of the resource. Return 403 if it is acceptable to reveal the resource exists but the user lacks permission.

Still having issues?

Check your network logs or use our developer tools to inspect headers, decode tokens, or validate your requests.