What does HTTP 301 mean?
The resource has a new permanent URL, given in the Location header. Browsers and caches remember 301s, and clients may change a POST into a GET when following one. Use 308 if the method must be kept.
3xx Redirection: The client must take another step — usually follow the URL in the Location header — to complete the request.
When you see 301
- A page or site moved to a new URL or domain.
- HTTP → HTTPS,
www→ non-www or trailing-slash normalization.
Best practices
- Point the redirect directly at the final URL — avoid chains of several redirects.
- Update internal links and the sitemap to the new URL so crawlers do not need the redirect.
301 and SEO
The standard way to move a page for SEO: search engines transfer ranking signals to the target and replace the old URL in results. Keep 301s in place for at least a year.
Example response
HTTP/1.1 301 Moved Permanently
Location: https://example.com/new-page
How to return a 301 response
Node.js (Express)
res.redirect(301, 'https://example.com/new-url');PHP
header('Location: https://example.com/new-url', true, 301);
exit;Python (Flask)
return redirect('https://example.com/new-url', code=301)Go (net/http)
http.Redirect(w, r, "https://example.com/new-url", 301)nginx
return 301 https://example.com/new-url;
Related status codes
- 302 Found — The resource is temporarily at a different URL, given in the Location header.
- 307 Temporary Redirect — Temporary redirect that keeps the request method and body.
- 308 Permanent Redirect — Permanent redirect that keeps the request method and body.
- 410 Gone — The resource has been permanently removed and will not return.
Check which status code a URL returns with the HTTP header checker, or trace a redirect chain with the redirect checker.
Preguntas frecuentes
What does status code 301 mean?
Location header.