HTTPError.net

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

451 Unavailable For Legal Reasons

Fault: Neither
TL;DR

Content blocked due to legal demands (censorship, DMCA).

The resource is unavailable due to legal reasons.

What HTTP 451 Unavailable For Legal Reasons Means

The resource is unavailable due to legal reasons.

Content blocked due to legal demands (censorship, DMCA).

Common Causes

How to Fix It (For Visitors)

How to Fix It (For Developers/Admins)

Returning a 451 Unavailable For Legal Reasons (Code Examples)

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

Node.js (Express)

app.get('/resource', (req, res) => {
  res.status(451).json({ error: 'Unavailable For Legal Reasons' });
});

Python (Flask)

@app.route('/resource')
def resource():
    return jsonify(error='Unavailable For Legal Reasons'), 451

PHP

<?php
http_response_code(451);
header('Content-Type: application/json');
echo json_encode(['error' => 'Unavailable For Legal Reasons']);

Check the status with curl

curl -I https://example.com/resource
# Look for: HTTP/1.1 451 Unavailable For Legal Reasons

Frequently Asked Questions

What does HTTP 451 Unavailable For Legal Reasons mean?

Content blocked due to legal demands (censorship, DMCA). In short: The resource is unavailable due to legal reasons.

Is 451 Unavailable For Legal Reasons a client or server error?

451 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 451 Unavailable For Legal Reasons error?

Return with legal blocking reason in response body. Specify blocking entity. Include legal reference.

Official Specification

The 451 Unavailable For Legal Reasons status code is defined in RFC 7725.

View the IANA HTTP Status Code Registry →