What 301 Moved Permanently means

301 Moved Permanently tells clients and search engines to update references to the new URL. It is cacheable by default and may be cached indefinitely. 302 Found is a temporary redirect; clients should keep using the original URL for future requests.

When a server should return it

  • 301: a page moved to a new canonical URL, a domain changed, or HTTP was upgraded to HTTPS permanently.
  • 302: maintenance pages, A/B tests, login flows, and any redirect that will be removed later.
  • 307/308: like 302/301 but guarantee the request method is preserved (a POST stays a POST).

Example response

http
HTTP/1.1 301 Moved Permanently
Location: https://example.com/new-path
Cache-Control: max-age=31536000

HTTP/1.1 302 Found
Location: /login?next=/dashboard
Cache-Control: no-store

Why you might see it unexpectedly

  • A 301 cached during a temporary experiment is hard to undo; users keep hitting the old target until the cache expires.
  • Trailing-slash and http→https rules often stack multiple 301s, slowing every first request.
  • Some clients change POST to GET on 301 and 302; use 307/308 if the method must survive.

Related status codes

302 Found is the temporary counterpart. 307 Temporary Redirect and 308 Permanent Redirect preserve the method. 304 Not Modified is caching, not redirection.