HTTPError.net

The fastest way to diagnose, understand, and fix any HTTP status code

404 Not Found

Fault: Client
TL;DR

The URL you're trying to access doesn't exist on the server.

The server cannot find the requested resource.

What HTTP 404 Not Found Means

The server cannot find the requested resource.

The URL you're trying to access doesn't exist on the server.

Common Causes

How to Fix It (For Visitors)

How to Fix It (For Developers/Admins)

Returning a 404 Not Found (Code Examples)

If you build APIs or web apps, here is how to send an HTTP 404 response and how to test for it:

Node.js (Express)

app.get('/resource', (req, res) => {
  res.status(404).json({ error: 'Not Found' });
});

Python (Flask)

@app.route('/resource')
def resource():
    return jsonify(error='Not Found'), 404

PHP

<?php
http_response_code(404);
header('Content-Type: application/json');
echo json_encode(['error' => 'Not Found']);

Check the status with curl

curl -I https://example.com/resource
# Look for: HTTP/1.1 404 Not Found

Frequently Asked Questions

What does HTTP 404 Not Found mean?

The URL you're trying to access doesn't exist on the server. In short: The server cannot find the requested resource.

Is 404 Not Found a client or server error?

404 is a 4xx client-error code, so the request itself needs to change. The server is running normally and is rejecting the request as it was sent by the browser, app, or API client.

How do I fix a 404 Not Found error?

Verify file exists on server. Check route configuration. Review URL rewrite rules.

Official Specification

The 404 Not Found status code is defined in RFC 7231 Section 6.5.4.

View the IANA HTTP Status Code Registry →