301 Moved Permanently

The resource lives permanently at the URL in the Location header, and clients should update their references. Browsers cache 301s aggressively — often with no practical expiry — which makes a wrong 301 one of the longest-lived mistakes you can ship.

What usually causes it

  • Domain or path migrations (http→https, www→apex, /old→/new)
  • Trailing-slash normalization by the framework
  • Accidental catch-all redirect rules

How to debug and fix it

  1. Follow the chain with curl -IL and fix loops or multi-hop chains (each hop costs a round trip; SEO tools flag chains > 1).
  2. Shipped a wrong 301? You cannot un-cache it from visitors' browsers — serve a corrective 301 from the wrong target, and test future ones as 302 first.
  3. For APIs, note that some old clients downgrade POST to GET on 301 — use 308 to preserve the method.
Worth knowing: SEO: 301 passes link equity to the new URL and is the correct signal for permanent moves. Google treats long-lived 302s similarly nowadays, but 301 removes the ambiguity.

Easily confused with