Skip to content
WebsiteHosting.com

concept / HTTP, TLS & web servers

HTTP redirects

A redirect response tells a client about another URI reference, typically through Location; the client decides whether to follow it. A 301/308 indicates a permanent move and 302/307 a temporary one. For a POST, 301/302 may permit conversion to GET under client behavior; 307/308 require preserving the *current* method. Each hop changes the input to the next hop, so the final result depends on the chain, not just its last status.

Updated · P0040

What it means

A redirect is an HTTP response followed, optionally, by a new client request. Location can be relative to the original request URI. It is not an internal server rewrite, and it does not guarantee that the next target is reachable or safe. Even an apparently valid chain can be stopped by policy, loops, invalid locations or client choice.

Try it

Redirect path and HTTP method trace

Simulation

In the simulation, start with the baseline and select the named preserve preset.

The first and second statuses, follow setting, and normal route remain unchanged. This is a synthetic trace; no network request or real service is changed.

Change the example locally

Selected scenario: baseline

two redirects followed

Path trace
/start → /next → /final
Method trace
POST → GET → GET
First response status
302
Second response status
307
301/302 policy not used
No

The first 302 follows the selected POST-to-GET policy, so the next method is GET. The second 307 preserves that current GET method at /final.

Predefined Location /start → /next → /final; no real requests.

Recent valid actions

The last ten valid changes in this local example. Reset clears this history.

    No changes recorded.

    Select Reset to return all controls and the selected scenario to the baseline: 302, POST-to-GET, follow Location enabled, 307, and the normal route. Reset clears local errors, history, comparisons, and temporary input values. It does not change whether the FAQ or About this model disclosures are open, and it changes no real server or external system.

    About this model

    This is a simulation of a fixed, two-redirect path, not a real HTTP request. It compares selected status codes and client policies; it does not model request bodies, cross-origin credentials, or every behavior of a real browser or other client.

    How it works

    A redirect response can include a Location URI reference. The client resolves a relative reference against the current request URI, but the response does not itself force a new request. If the client follows, the status and client behavior determine the method at the next hop. In particular, 301 and 302 permit POST-to-GET conversion; 307 and 308 preserve the current method during automatic redirection. See RFC 9110’s redirect semantics.

    Track the method as state. Suppose the original POST encounters a 302 and the client chooses the permitted POST-to-GET behavior. The next request is GET; a subsequent 307 preserves GET, not the historical POST. By contrast, if the first hop is 307, the next request retains POST and its content if the client follows. These differences matter when a chain crosses origins or touches a state-changing endpoint; the model does not replay real requests.

    A worked example

    In the baseline simulation, POST /start receives a 302 with Location /next. The selected client policy converts POST to GET, so the next request is GET /next. Its 307 points to /final and preserves that current GET, producing GET /final. The second redirect preserves what it receives, not the original POST.

    What changes the conclusion

    A server-internal rewrite is different: the server maps a request internally rather than sending the client an HTTP redirect to follow. An address change in a configuration alone therefore does not establish that a new client request occurred. Apache’s rewrite examples illustrate the distinction.

    In practice

    For a real service, first obtain permission and inspect existing response records or a read-only trace: note each request method, response status, and Location. If a redirect was not followed, the next response is unknown, not a confirmed failure. A loop, an invalid target, a client’s choice not to follow, or an unavailable destination can produce different problems; the symptom alone does not identify which one occurred. Do not automatically replay a state-changing POST as a test.

    When inspecting a production chain with authorization, record the method, effective URI, response status and Location at every observed hop. Stop on unknown or unobserved next responses rather than declaring success. Avoid automatic replay of sensitive POST bodies to unexpected targets, and validate that a proposed redirect does not loop before enabling it.

    Limits and unknowns

    The simulation uses predefined routes and stops on an invalid Location fixture or a detected loop; it does not walk arbitrary redirect chains or enforce a numeric hop limit. A stopped or unevaluated next step is not a confirmed negative response from a destination. Likewise, a successful simulated trace does not establish that a real service works.

    What to take away

    Diagnose redirects one response at a time: status and client behavior determine the next URI and method, and each next request becomes the input to the following step. If the trace stops or the destination is unknown, no later result has been established. A synthetic two-hop success cannot substitute for a read-only observation of the real service.

    POST /start302 found

    optional rewrite

    GET /nextclient chose POST→GET

    mandatory preservation

    GET /final307 preserves current method
    Under the selected 302 client policy, POST converts to GET. A following 307 preserves GET; it cannot resurrect the original POST. This is a fixed path trace without HTTP requests. Static example; it does not change with the interactive controls.

    Frequently asked questions

    Editorial questions, supported by the references below.

    If GET follows an earlier POST-to-GET redirect, can 307 restore POST?

    No. A 307 preserves the current request method if followed. After an earlier 302 has converted POST to GET under the chosen client policy, a later 307 preserves GET; it does not recover the original POST.

    References: HTTP01
    What does Location tell you if following redirects is disabled?

    Location identifies a possible next target, possibly relative to the current URI. If following is disabled, no next request is made in the model, and the target’s response remains unobserved.

    References: HTTP02
    When should a redirect simulation stop?

    Stop when Location is invalid, a loop is detected, the selected policy does not follow or a next outcome is unobserved. This two-hop model does not assert a general browser hop limit or invent a destination response.

    References: HTTP02
    Does a valid redirect response prove the final site works?

    No. The server can return a conforming redirect while the client declines to follow it or the destination fails. Verify the observed chain and final application behavior independently.

    References: HTTP02

    Sources & model boundaries

    The interactive is a local educational simulation, not a live check. Protocol references and WebsiteHosting.com operating rules are identified separately.

    1. HTTP01 — Protocol or bounded model reference

      HTTP 301 and 302 permit user agents to change POST to GET; 307 and 308 require preserving the method during automatic redirection.

      HQ reviewed targeted core claim; no complete current errata/updates audit or all-sentence factcheck

      • RFC 9110 — RFC9110 §§15.4.2,15.4.3,15.4.8,15.4.9, verified erratum7109

      Recorded targeted check: .

    2. HTTP02 — Protocol or bounded model reference

      A Location field can identify a redirect target, but following it depends on user-agent behavior and status semantics.

      HQ reviewed targeted core claim; no complete current errata/updates audit or all-sentence factcheck

      Recorded targeted check: .

    Report an issue. Include the article URL and ID, not passwords or access keys.