301
HTTPREDIRECTNotable3xx RedirectionHIGH confidence
Moved Permanently
Production Risk
Low if implemented correctly. Incorrect implementation can lead to redirect loops or hurt SEO by sending search engines to the wrong place.
What this means
The URL of the requested resource has been changed permanently. The new URL is given in the response. Search engines will update their links to the resource, and browsers may cache this response indefinitely.
Why it happens
- 1A website restructures its URL scheme, moving /old-page.html to /new-page/.
- 2A site migrates from HTTP to HTTPS.
- 3A company rebrands and moves its entire domain from old-name.com to new-name.com.
How to reproduce
A website permanently changes its domain name and needs to redirect all traffic from the old domain to the new one.
trigger — this will error
trigger — this will error
curl -I http://example.com
expected output
HTTP/1.1 301 Moved Permanently Location: https://www.example.com/
Fix
Configure Server-Side Redirect
WHEN A resource's location has permanently changed.
Configure Server-Side Redirect
// Example in Nginx config rewrite ^/old-path/(.*)$ /new-path/$1 permanent;
Why this works
Server Configuration
What not to do
✕
Sources
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev