301 Moved Permanently

The resource has a new permanent URL, given in Location. Clients and search engines should update their references.

Status

HTTP/1.1 301 Moved Permanently

Details

301 is the canonical way to move a URL. Search engines transfer ranking signals to the target, browsers cache the redirect aggressively, and well-behaved clients rewrite stored links. That permanence is the point, and it is also the danger: a wrong 301 can be cached in a browser for a long time and is painful to undo.

For historical reasons clients are allowed to rewrite a POST to the new URL as a GET, and in practice they do. If the method must be preserved, use 308 instead.

Note: Browsers cache 301s aggressively and can hold them for a long time. Use a short max-age while a migration is still being validated.

Headers

Common causes

Usage notes

For clients

For servers

Examples

Moving a page permanently

A request for a URL that has moved:

HTTP request

GET /old-product HTTP/1.1
Host: www.example.com

The response names the new permanent URL. Clients and search engines are expected to update their references:

HTTP response

HTTP/1.1 301 Moved Permanently
Location: https://www.example.com/products/new-product
Cache-Control: max-age=3600

Notes for proxy users

Redirect behavior is one of the clearest signals when testing a proxy: a site that answers a residential IP with 200 but answers a flagged datacenter IP with a 301 to a challenge page is doing IP-based filtering rather than blocking outright.

Specifications

See also