Skip to content

Redirect

A redirect is a server or client rule that sends a request from one URL to another, so the browser or crawler that asked for the old address ends up at the new one.

Definition

What it is

A redirect is an HTTP response with a 3xx status code plus a Location header. The client (a browser, a curl, a crawler) reads the header and re-sends the request to the new URL. The redirect itself carries no content; the content lives at the destination.

There are two families. Permanent redirects (301, 308) tell the client and search engines that the move will not revert. Temporary redirects (302, 303, 307) tell them the move is temporary and the old URL will return. The difference matters for SEO: search engines transfer ranking through 301s but do not through 302s.

Why it matters

Every URL on the web is a link somewhere: a bookmark, an email, a tweet from 2015, a citation in a paper, a backlink from a blog that was abandoned in 2019. When the URL changes, those external references break. A 301 fixes them: the client lands at the new destination, the link survives, and the search engine updates its index. Without a redirect, every external reference becomes a 404, and Google transfers no ranking to the new URL.

Status codes

Code

Name

Permanence

Method preserved

Typical use

301

Moved Permanently

Yes

No (GET)

URL changes forever

302

Found

No

No (GET)

Temporary move

303

See Other

No

Yes (GET)

Post/Redirect/Get

307

Temporary Redirect

No

Yes

Temporary, preserve POST

308

Permanent Redirect

Yes

Yes

Permanent, preserve POST

How redirects work

sequenceDiagram
  participant C as Client
  participant S as Server
  C->>S: GET /old-url
  S-->>C: 301 Location: /new-url
  C->>S: GET /new-url
  S-->>C: 200 OK

Common failures

Redirect chains: the silent debt

  1. Year 1 — Site launches with /article-name/.

  2. Year 2 — Renamed to /2024/article-name/ → 301 added.

  3. Year 3 — Site restructured to /blog/article-name/ → second 301 added.

  4. Year 4 — Migrated to /posts/2024/article-name/ → third 301 added.

  5. Year 5 — Crawler follows 4 hops per request, ranking diluted.

How to redirect without breaking

Redirects that age well

  1. 301 for permanent, 302 for temporary

    If the move will last more than a few months, 301. If uncertain, 302 and revisit.

  2. Redirect to the final URL

    Never redirect A→B and B→C. Redirect A→C directly. Chains dilute ranking.

  3. Log every redirect

    A redirects.yaml in the repo makes changes auditable and revertible.

  4. Audit every quarter

    Run curl -sI https://example.com/old | grep -i location on every redirect in your map. Chains and loops appear quietly.

Origin

The word is Latin: re- (again) + dirigere (to direct, to guide). In English, "redirect" was used in postal and telephone contexts in the 20th century: to redirect a letter, to redirect a call. The web sense arrived with HTTP/0.9 (1991), which returned a document or nothing. HTTP/1.0 (RFC 1945, 1996) formalized 301 and 302 as the first redirect status codes. HTTP/1.1 (RFC 2616, 1999) added 303, 305, 307. RFC 7231 (2014) added 308. RFC 9110 (2022) consolidated the semantics.

The 301 (Moved Permanently) status code indicates that the target resource has been assigned a new permanent URI and any future references to this resource ought to use one of the enclosed URIs.

— RFC 9110, Section 15.4.2, 2022
1996 · HTTP/1.0 formaliza 301 y 302
1999 · HTTP/1.1 añade 303, 305, 307
2014 · RFC 7231 añade 308
2022 · RFC 9110 unifica
5 · hops máximo antes de que Google trunque la cadena

Evidence

FAQ

301 vs 302?

301 is permanent and transfers ranking. 302 is temporary and does not. If in doubt, 302 first, 301 later.

Does a redirect lose ranking?

A 301 transfers most ranking but not all; the drop is small and permanent.

How long should I keep a 301?

Forever. Google recommends keeping it "as long as the old URL is needed"; in practice, never delete a 301.

What about redirect loops?

A→B and B→A is a loop; the client hits a wall after ~20 attempts. Always verify the destination actually resolves to 200.

Connections

Etymology

Origin: borrowed

  • re (prefix): Latin, "again"
  • dirigere (verb): Latin, "to direct, to guide"

Semantic network

RedirectwebSEO301 redire302 redireRedirect ccanonicalPermalinkSEO

● broader ● narrower ● related

Used in the garden

Sources