HTTP 301 — Moved Permanently
3xx Redirection
What it means
The resource has a new permanent URL. Search engines transfer ranking signals to the target and update their index.
What to do about it
Use 301 for permanent moves — HTTP to HTTPS, www consolidation, changed URL structure. Browsers cache it aggressively, so a wrong 301 is painful to undo.
Where it sits
301 belongs to the 3xx family: Further action is needed to complete the request — usually following a redirect.
HTTP/1.1 301 Moved Permanently
Checking it yourself
# see the status code and headers only
curl -sI https://example.com/path
# follow redirects and print each hop
curl -sIL -o /dev/null -w "%{http_code} %{url_effective}\n" https://example.com/path
# JavaScript
const r = await fetch(url);
console.log(r.status, r.statusText);
How this code behaves
| Cacheable by default | Yes — per RFC 9110, this status is cacheable unless headers say otherwise. |
| Safe to retry | Not applicable. |
| Effect on search indexing | Ranking signals transfer to the target URL. This is the correct status for a permanent move. |
Returning 301 correctly
# nginx
return 301;
# Express
res.status(301).json({ error: 'Moved Permanently' });
# Go
w.WriteHeader(301)
# Python (Flask)
return jsonify(error='Moved Permanently'), 301;
Frequently asked questions
What does HTTP 301 mean?
The resource has a new permanent URL. Search engines transfer ranking signals to the target and update their index.
How do I fix a 301 error?
Use 301 for permanent moves — HTTP to HTTPS, www consolidation, changed URL structure. Browsers cache it aggressively, so a wrong 301 is painful to undo.
Is 301 a client or server problem?
Neither — it is an instruction to look somewhere else, and clients normally follow it automatically.