HTTP 301 Moved Permanently
HTTP 301 Moved Permanently means the resource now lives at a new URL given in the Location header, and the move is permanent. Browsers cache it and search…
Quick answer
HTTP 301 Moved Permanently means the resource now lives at a new URL given in the Location header, and the move is permanent. Browsers cache it and search engines transfer ranking signals to the new URL, which makes 301 the standard redirect for site migrations and URL changes.
Last updated · Maintained by FreeAIToolz · How we test
What does HTTP 301 Moved Permanently mean?
Clients should use the new URL from now on. Historically, browsers change a POST into a GET when following a 301, so for APIs that must keep the method and body, use 308. Because browsers cache 301s aggressively, test redirects carefully before deploying.
| Status code | 301 |
|---|---|
| Name | Moved Permanently |
| Class | 3xx Redirection |
| Defined in | RFC 9110 §15.4.2 |
| Cacheable by default | Yes (heuristically cacheable) |
| Safe to retry automatically? | Not applicable |
| Related headers | Location |
What causes HTTP 301?
- A URL was renamed or a site moved to a new domain or path structure.
- HTTP→HTTPS or non-www→www normalisation.
How do I fix HTTP 301?
- Redirect each old URL to its closest equivalent, not everything to the homepage (Google may treat that as a soft 404).
- Avoid chains: point A directly to C rather than A→B→C.
- Update internal links and the sitemap to the final URL so crawlers do not depend on the redirect.
What should a client do after HTTP 301?
Follow the Location header and update saved links or bookmarks.
Does HTTP 301 affect SEO?
The preferred redirect for permanent moves. Google treats 301 and 308 as strong signals that the target should become canonical and passes ranking signals to it. Keep redirects in place for at least a year.
Example 301 response
HTTP/1.1 301 Moved Permanently
Date: Mon, 01 Dec 2026 12:00:00 GMT
Location: https://www.example.com/new-page/ How to return 301 Moved Permanently in code
Express (Node.js)
res.redirect(301, '/new-url'); Next.js route handler
return Response.redirect(new URL('/new-url', request.url), 301); Flask (Python)
return redirect('/new-url', code=301) PHP
header('Location: /new-url', true, 301);
exit; Nginx
location = /old-url {
return 301 /new-url;
} Other 3xx status codes
Further action is needed, usually following the Location header to another URL.
Frequently asked questions
301 vs 308?
How do I clear a cached 301 in Chrome?
Is 301 a client or server error?
Related
- 308 Permanent Redirect HTTP 308 Permanent Redirect means the resource has moved permanently to the URL in the Location header, and th.
- 302 Found HTTP 302 Found is a temporary redirect: the resource is currently at the URL in the Location header, but clien.
- 307 Temporary Redirect HTTP 307 Temporary Redirect sends the client to the URL in the Location header for now, and requires it to rep.
- 410 Gone HTTP 410 Gone means the resource used to exist but has been permanently removed and will not come back, with n.
- Open the HTTP Status Codes Reference → Free, no signup.