The resource has a new permanent URL.
When to use it
Old URLs after a site restructure. Browsers and search engines remember it.
Good to know
For SEO, 301 tells search engines the move is permanent, so Google transfers ranking signals and replaces the old URL with the new one in its index. Google treats 301 and 308 the same and passes signals through long-lived 302s too, but a 302 can keep the old URL indexed for longer. Keep 301s in place for at least a year and point them straight at the final URL, not through a chain.
Browsers cache 301 aggressively, often with no expiry, so a mistaken redirect can stick in users’ browsers long after you fix the server. Test with 302 first, or send Cache-Control: max-age=3600 on the redirect. Clients may turn a POST into a GET when following a 301; use 308 to keep the method. Update internal links and sitemaps to the new URLs rather than relying on redirects.
Redirection (3xx)
3xx codes are redirections: the client has to go somewhere else, or use its cached copy, to finish the request.
What it looks like
HTTP/1.1 301 Moved PermanentlyHow to send it
| Node.js / Express | res.redirect(301, '/new-url') |
|---|---|
| Python / Flask | return redirect('/new-url', code=301) |
| nginx | return 301 https://example.com$request_uri; |
How to check it
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/