Four common HTTP redirects answer two separate questions: is the move permanent or temporary, and must the next request preserve the original method and body? 301 and 308 describe permanent moves. 302 and 307 describe temporary ones. For non-GET requests, 307 and 308 explicitly preserve the method and body, while historical handling of 301 and 302 can change a POST to GET.

Choose a code based on what the old URL represents and what the destination should do with the redirected request. A page move, a temporary maintenance route, and a form submission have different needs. Then test the complete chain with the methods real clients use; a redirect that works for a browser navigation may fail for an API request.

Decide Whether the Move Is Permanent

Use a permanent redirect when the old resource has a stable new location and clients should update references to that destination. 301 Moved Permanently is common for a changed page URL reached through GET. 308 Permanent Redirect expresses the same permanence while requiring the redirected request to keep its original method and body.

Use a temporary redirect when the original URL remains the address clients should use in the future. 302 Found can send visitors to a temporary destination. 307 Temporary Redirect does so without changing the request method or body. Maintenance or a phased rollout may use a temporary rule, while a permanent content migration calls for a permanent one.

Do not choose permanence based only on how long a configuration might remain active. The status tells clients and crawlers whether the original URL should remain the usual address for future visits. A rule meant for a short experiment should not be marked permanent merely because it is easy to configure that way.

Preserving the Request Method and Body

For ordinary GET navigation, all four codes can lead a client to fetch a destination. The distinction becomes critical for POST, PUT, or other non-GET methods. A client may change POST to GET after a 301 or 302, discarding the submitted body. That permission does not extend to every non-GET method; PUT is not interchangeable with POST. If the redirected operation depends on preserving a POST body, choose 307 or 308.

307 and 308 prohibit that method change. If an API endpoint temporarily moves and the client must resend the same operation at the new URL, 307 is the relevant choice. If the move is permanent and the method must stay intact, use 308. Confirm that the destination accepts the same operation and that forwarding the body to that destination is safe and intended.

Sometimes the desired behavior is to complete a form submission and show a separate result page through GET. That is a different pattern, commonly served by 303 See Other. Do not select a method-preserving redirect if it would unintentionally repeat a state-changing action at another endpoint.

Caching and Future Requests

A cache can reuse a 301 or 308 response without an explicitly stated expiration time when the method and other cache rules allow. A 302 or 307 can also be cached if its headers explicitly allow caching. Permanent and temporary describe the URL move, not a promise about how many seconds the response will remain in a cache. Test with an empty cache as well as with a browser that may have saved an earlier response.

Before enabling a permanent rule, confirm that the target exists, uses the intended protocol and host, and will remain appropriate. Changing a redirect rule on the server does not immediately remove copies that clients have already cached. A client may keep using its saved destination without contacting the original server until the cached response needs to be checked again. When a path is only being tested, start with a temporary status and a controlled cache policy, then switch after validation.

For Google Search, a permanent redirect signals that the new URL should represent the content in search results. A temporary redirect does not provide that same signal, although other signals can still lead to the new URL being indexed. The redirect code alone does not guarantee a particular ranking or a fixed amount of ranking improvement.

Examples of Permanent and Temporary Moves

If an article has moved permanently from an old path to a closely matching new path and visitors use GET, a 301 is a conventional choice. If an API route is permanently renamed while clients still send POST, 308 conveys that the same method and body must reach the new route. The destination should be authorized to receive that data.

For temporary maintenance of a read-only page, a 302 can send visitors to an alternate page while keeping the original URL meaningful. If a temporary API routing change must preserve PUT requests, use 307. The redirected API endpoint must still support the same operation; preserving PUT does not make a page designed only for GET accept an update.

Do not redirect every missing page to the home page. A missing resource may require a 404 response, or 410 when the removal is known to be permanent. An unrelated destination can confuse visitors and hide broken links. Redirect to a replacement that serves the old URL's purpose. Update internal links to the new URL after a permanent migration so visitors do not incur avoidable redirect hops.

Verify the Destination and Full Chain

Inspect the initial response status and Location header, then follow the chain to the final response. Check for loops, extra hops, a downgrade from HTTPS to HTTP, a changed host, and a final error. For APIs, test the actual method and body against an authorized test endpoint using data that can be safely changed or removed. Confirm what the destination received, not just that the client followed a URL.

Repeat the checks with each browser or API client you support, including after a previous redirect has been cached. Record the source, destination, status, method before and after redirect, final status, and date. If a proxy or content delivery network (CDN) handles the rule, inspect the response that actually reaches the client. The rule on the origin server may be correct while an intermediary still serves an older redirect or adds another hop. Correct the rule at the component that produces the unexpected response, then check the full chain again.