Five families
HTTP status codes fall into ranges by their leading digit. The one hundreds are informational, two hundreds are success, three hundreds are redirection, four hundreds are client errors, and five hundreds are server errors. Reading the first digit tells you who is at fault and what to do next.
How redirects work
A three hundred response carries a Location header pointing at a new URL. The browser follows it automatically. The exact code matters:
- 301 Moved Permanently says update bookmarks and pass link value to the new URL.
- 302 Found and 307 Temporary Redirect are temporary; 307 preserves the original method while old clients sometimes switched 302 to GET.
- 308 Permanent Redirect is the method preserving permanent form.
- 304 Not Modified is special: it tells a cache its stored copy is still valid.
Avoiding loops
Chained redirects add round trips, and a misconfigured pair can form an infinite loop, which browsers cut off after a limit. Prefer a single hop to the final URL.
Key idea
Status codes group into five families by first digit, and 3xx redirects send the client to a Location while the specific code decides permanence and method handling.