workspacereference / tools / guidesPUBLIC TOOLS
Forgegrid Tools
Browse ▾
GUIDES / HTTP REFERENCE

Redirects are changes to request flow.

A redirect tells a client to request another location; its status code also affects method handling and future caching.

Editorial team ·

Choose the code for the intent

A permanent relocation typically uses 301 or 308, while a temporary move may use 302 or 307. The 307 and 308 codes preserve the request method; legacy client behaviour around 301 and 302 can rewrite POST to GET. A 303 explicitly directs the client to retrieve the target, commonly with GET. These differences matter for form submissions and API calls more than they do for a person clicking an ordinary link.

Keep Location unambiguous

A redirect response normally supplies Location with a target reference. Make sure relative targets resolve under the intended base URL and do not accidentally point back to the same resource. If an application uses forwarded headers to reconstruct a public address, validate the proxy boundary. Otherwise an untrusted Host value can influence a redirect. A static site usually needs only a few clear, manually controlled transitions.

Avoid redirect chains

A chain of several redirects adds requests and makes errors harder to diagnose. Inspect each hop with a tool that shows status and Location rather than jumping straight to the final document. Confirm that canonical routes do not loop and that a missing resource still returns 404 when no intentional replacement exists. A broad redirect rule may hide broken links, but it can also send unrelated paths to an unhelpful homepage.

Test non-GET methods

When changing a redirect used by an application, try the same method and body that a client sends. A route that looks fine in a browser address bar may fail for a POST request or an automated client. Record whether credentials or sensitive query strings can leak across destinations. If the redirect policy is uncertain, keep the change narrow and observe the complete response exchange before relying on cached permanent results.

Related reading

Continue with the guides index, or explore the overview for the wider context. Use a test resource on a server you control and inspect the complete response, including status and headers. Change one condition at a time, so the result remains interpretable. The guide explains protocol behaviour; it does not assert measurements from an external service.