📚 Quick Definition
The target resource has been assigned a new permanent URI and any future references should use the new URI. Search engines will update their index to the new URL. This is the most important redirect for SEO and is used when a page's URL changes permanently.
⏱ When It Occurs
A 301 response is returned when a server wants to tell clients and search engines that a resource has permanently moved to a different URL. The server includes a Location header with the new URI. Browsers automatically follow the redirect, and search engines transfer ranking signals to the new URL.
🛠 Common Use Cases
- HTTP to HTTPS migration (redirecting all HTTP traffic to HTTPS)
- Domain name change (old-domain.com to new-domain.com)
- Removing www or adding www (standardizing the URL format)
- URL structure change (e.g., /blog/post-title to /articles/post-title)
- Merging duplicate content under a single canonical URL
- Old permalink to new permalink after a CMS migration
✅ Best Practices
- Always include a Location header with the new URL in the response
- Use 301 only for permanent URL changes - use 302 or 307 for temporary changes
- 301 passes most link equity (SEO juice) to the new URL
- Be aware that 301 may change POST to GET - use 308 if the method must stay the same
- Submit the new URL to Google Search Console to speed up re-indexing
- Update your internal links too - don't rely solely on the redirect
📡 HTTP Example
GET /old-page HTTP/1.1 Host: www.example.com
HTTP/1.1 301 Moved Permanently Location: https://www.example.com/new-page Content-Length: 0