Перейти до основного вмісту

Guides / http-status-codes

3xx redirection status codes

A 3xx status code is a redirect: the resource you asked for is somewhere else, and the response's Location header says where. The specific code tells the client, and every search engine, whether the move is permanent or temporary and whether the original request method must be preserved.

How a redirect works

A redirect is two requests, not one. The client asks for URL A, the server answers with a 3xx status and a Location header naming URL B, and the client then makes a fresh request to B. Browsers follow this automatically, so a visitor sees only the final page and the final URL in the address bar. The intermediate response still costs a full round trip, which is why long redirect chains are slow.

Two properties separate the 3xx codes from each other. The first is permanence: a permanent redirect tells clients and crawlers that the old URL is retired and the new one should replace it in bookmarks, links and indexes, while a temporary redirect says the old URL is still the real one and will come back. The second is method preservation. The older codes let a client turn a POST into a GET when it follows the redirect, and the newer ones forbid that, so a POST stays a POST. That is the difference between a form submission arriving at the new URL intact and one arriving as an empty GET.

Every 3xx code and what it means

  • 300 Multiple Choices. The resource exists in several representations and the server is letting the client pick. There is no standard machine-readable format for the list, so almost nothing implements it. In practice you will not see a 300 in the wild. See the 300 Multiple Choices guide for why it survives mostly as a search term.
  • 301 Moved Permanently. The resource has a new permanent home. Search engines transfer ranking signals to the target, and clients are allowed to cache the redirect, sometimes aggressively. This is the code for a domain change, an HTTP to HTTPS move or a permanent URL restructure.
  • 302 Found. A temporary redirect. The original URL keeps its identity, so search engines normally keep indexing the original rather than the target. Historically many clients switched the method to GET when following a 302, which is why the standard warns against relying on method preservation here.
  • 303 See Other. "Your request was processed; now go and GET this other resource." The client is explicitly told to use GET for the follow-up regardless of the original method. This is the correct answer to a form POST that should land on a result page.
  • 304 Not Modified. Not a redirect at all. It answers a conditional request and means "your cached copy is still current, reuse it". There is no body and no Location. See 304 Not Modified.
  • 305 Use Proxy and 306 are obsolete. 305 was deprecated for security reasons and 306 is unused. Ignore both.
  • 307 Temporary Redirect. Same meaning as 302, but the method and body must be preserved. A POST that follows a 307 arrives at the new URL as a POST.
  • 308 Permanent Redirect. Same meaning as 301, but the method and body must be preserved.

What goes wrong with redirects

  • A temporary code on a permanent move. The most common and most expensive mistake. Search engines keep the old URL indexed and the new one does not inherit the old one's standing.
  • A permanent code on a temporary move. Harder to undo, because a cached 301 can keep sending returning visitors to the wrong place long after you remove the rule.
  • Redirect chains. http to https, then non-www to www, then old path to new path is three round trips before any content arrives. Each hop adds latency and each hop is a place where the chain can break.
  • Redirect loops. A sends to B and B sends back to A, usually because an application-level rule and a server-level or CDN-level rule disagree about the canonical form. Browsers give up after a fixed number of hops and show an error.
  • Everything pointed at the home page. When retired pages all redirect to the root instead of their closest equivalent, the redirect is often treated as a soft 404 and the visitor is left hunting.
  • Lost POST bodies. An API or form endpoint moved behind a 301 or 302 can lose its method and payload with some clients. Use 307 or 308 for anything that is not a plain GET.

How to audit and fix your redirects

  1. See what a URL returns, without following:
    curl -sI https://example.com/old-page | grep -Ei "^(HTTP|location)"
    That prints the status line and the target in one go.
  2. Now follow the whole chain and count the hops:
    curl -sIL -o /dev/null -w "%{num_redirects} hops, final %{http_code}, %{url_effective}\n" https://example.com/old-page
  3. Collapse chains to one hop. Point the original URL directly at the final destination instead of letting it walk through intermediate rules.
  4. Match the code to the intent. Permanent move: 301, or 308 if the endpoint accepts non-GET requests. Temporary move, maintenance page or A/B split: 302, or 307 where the method must survive. Post-then-redirect flow: 303.
  5. Fix loops by deciding the canonical form once (protocol, host and trailing slash) and enforcing it in exactly one layer. Loops almost always mean two layers are both trying to be authoritative.
  6. Re-test with a cold cache. A browser that has cached a 301 will keep obeying it, so verify with curl or a private window before concluding the fix did not work.

Catching a broken redirect before traffic drops

Redirects break without any visible symptom. A rule that starts looping, or a certificate that fails on the redirect target, still leaves the old URL responding, so nothing looks wrong until traffic and rankings drop. An external check that follows the chain and asserts the final status catches a broken redirect the moment it appears, and checking from many networks separates a global rule change from a regional CDN problem. HostTracker runs checks from 300+ checkpoints in 158 cities and alerts by email, SMS, voice call, Slack, Telegram and more. Test a URL and its redirect chain with the HTTP check tool, and read 301 vs 302 before you pick a code.

Check it now

Run the free check against your own site - no account needed.

HTTP check

Monitor this permanently

Get alerted the moment it breaks: HostTracker checks from 300+ locations and notifies you by email, SMS, Slack, Telegram and more.

HostTracker features