A story about losing search rankings after a domain change
A site moved example.com entirely to example.net using the platform's default redirect. Three months later traffic halved—because the default was 302 (temporary), so search engines never transferred the old domain's weight to the new one, treating it as a temporary borrow. One line unlocks it: permanent change → 301, temporary borrow → 302, keep the method → 307/308. This article clarifies the four, and steers you past the SEO and form-redirect traps.
Four statuses in one table
| Status | Name | Semantics | Cached? | Method change |
|---|---|---|---|---|
| 301 | Moved Permanently | permanent | ✅ (browser+SEO) | POST→GET |
| 302 | Found | temporary | ❌ | legacy POST→GET |
| 303 | See Other | view with GET | ❌ | intentional to GET |
| 307 | Temporary Redirect | temporary, keep method | ❌ | keep method |
| 308 | Permanent Redirect | permanent, keep method | ✅ | keep method |
Key: 301/308 are cached and permanent; 302/307 are not cached and temporary; 303 explicitly says "after redirect, please GET". The most-often-hit trap is 301/302 silently turning POST into GET.
The Location header and chains
A redirect tells the client where to go via a response header:
HTTP/1.1 301 Moved Permanently
Location: https://new.example.com/path/to/page
- The client must read Location to decide the next hop;
- a relative Location resolves to an absolute URL against the current one;
- a link may chain through several hops (A→B→C→final); browsers follow to the end but give up and error past roughly 20 hops;
- longer chains are worse for users and crawlers alike (extra round trips)—reach it in one hop where possible.
SEO trap: should weight transfer?
301 → passes as much link weight to the new URL as possible (do this for permanent migration)
302 → passes no weight, only borrows temporarily (A/B tests, launch transitions)
- Substantially different content behind a 301 → read as a downgrade;
- Whole-site 301-to-home → looks like dead-link aggregation; prefer per-path mapping;
- For links you can't fully map, at least keep a maintained 301 table so the map doesn't go missing pages.
Redirect loops: what's going on
A→B→A, or A-self-reference, is a loop. Triggers usually live in middleware: trailing-slash rules, http↔https swaps, www canonicalization, or CDN-vs-origin rule conflicts. Defense and diagnosis:
# watch which hop returns to the origin
curl -I -L --max-redirs 10 https://old.example.com
Clients typically give up after ~20 hops; on the server, decide whether to redirect only after normalizing, to avoid ambiguous rules stepping on each other.
Self-check
Pick a status code for each need and justify it:
- Old pages all moving under
archive/, old URLs retired permanently; - Running a one-day gray release on a new design, possibly rolled back anytime;
- Redirecting a user back to a list page after a form submit.
(Answers: ①301; ②302 or 307; ③303 or 307/302 — explaining the equity/flow reasoning is what counts.) Being able to state the why means you've passed the semantics boundary test.