301 vs 302 redirects and when to use 307 or 308

An old guide and a checkout under maintenance call for different redirects. Use the comparison table to pick a status code, then check what actually happens from the original URL to the final page.

By Asaf Mazuz 8 min read

A browser URL branches toward a permanent destination marked 301 and a temporary destination marked 302.

Use 301 or 308 for a permanent move and 302 or 307 for a temporary one. When a client follows a 307 or 308, it must keep the original request method. With 301 and 302, it may turn a POST into a GET. That matters if you’re redirecting a form submission or an API call. HTTP Semantics specification.

Ask two questions before you change the route. Will the old URL come back? Does anything submit data to it? For a page people visit with GET, permanence usually decides the code. For submissions, check what the target does with the method and body.

Compare 301, 302, 307, and 308

Code

Duration

Request behavior

Example

301

Permanent

A client may change a POST to a GET

An old article has a permanent replacement

302

Temporary

A client may change a POST to a GET

A landing page points to a temporary event page

307

Temporary

A client that follows it must preserve the method

A compatible submission endpoint moves during maintenance

308

Permanent

A client that follows it must preserve the method

A compatible API endpoint moves permanently

Test a form or API redirect with a real client in a test environment. Opening the old URL in a browser only exercises the GET path.

A browser that opens an ordinary page sends a GET and can follow any of these four redirects with a GET. A form that submits with POST has a different job. If the client follows up with GET, the destination may display a page without processing the submission.

Before you use a method-preserving redirect, confirm the new endpoint accepts the same method and body. Test it with the clients people actually use and check permissions, authentication, and cross-origin behavior. HTTP Semantics specification for 301, 302, 307, and 308.

How Google treats permanent and temporary redirects

Google uses permanent redirects as a signal that the target should become canonical. A temporary redirect signals that the original URL should remain canonical. Align your internal links, sitemap, and canonical tags with the URL you want indexed, and give Google time to recrawl both addresses. Google Search redirect guidance.

A permanent content move is clearer when every signal points to the same place. If you rename a guide, set a permanent redirect from the old URL to the new equivalent, list the new URL in your sitemap, and update internal links. Make the new page respond successfully and make its canonical reflect its intended address. That makes the change easier for both a crawler and a person clicking an old link.

For a temporary checkout maintenance page, use a short-lived redirect if the original entry should return. Keep the original address available as your link in documentation, and remove the temporary redirect when maintenance ends. Check what the user sees if the destination is an outage notice, login screen, or a page meant for a different region.

Avoid bundling several old pages into a generic destination when you have a closer match. Someone looking for an installation guide expects the corresponding guide or a clear replacement. If there is no equivalent page, make a deliberate choice about whether a response saying the resource is missing would be more accurate for visitors. Google documents handling of missing content and redirects in its site-move guidance. Google Search site moves.

Examples for pages, campaigns, and forms

Moving an old guide to a new path

Say your app’s guide moved from /how-to-install to /docs/installation. If the new guide covers the same task and the move is permanent, a 301 works for ordinary visits. Update menu links, support emails you can edit, and the sitemap to use the new address. Verify that a visit to the original URL gets one redirect and the new URL serves the guide.

Record the original address in your redirect map. A customer can keep a saved email or PDF for months. If you rename the guide again later, point the first historical URL at the latest destination directly. This avoids sending everyone through a trail of previous filenames.

Running a short-lived event campaign

Imagine a webinar in two weeks. Your marketing team wants the product’s demo link to show a live registration page during a short window. If the usual demo address should resume afterward, a temporary redirect expresses that expectation. Decide in advance who will remove it and test the regular path again the day after the event.

If the webinar invitation and the regular demo are distinct offers, a separate tracked link may be a better fit operationally. That leaves the regular demo page available and gives you a specific source to look for in the campaign report. Create the event link for the invite, landing page, and newsletter issue you can identify later.

Moving a form submission or API endpoint

If a client sends a POST request to an old endpoint, test the supported client against the proposed new destination before returning a method-preserving code. Confirm the response, how authentication flows through the request, and whether a repeated submission creates extra work. Try a successful request and an expected rejection, then inspect the destination’s actual behavior.

Be especially careful if the target is on a different origin. A client can limit forwarding credentials or prohibit redirects, and a browser may enforce its own origin rules. Whenever clients can be updated safely, point them directly to the new endpoint and give operators a migration window. A redirect can help a compatible client reach a new route during the transition.

Check every hop in the chain

One link can go through three different systems. The old host sends it to HTTPS, the app routes it to a new domain, and the new site chooses a local storefront. Write down the status and destination at each step.

Start with the URL people will click. Open the Redirect Checker and check each status and destination. Look for repeated hops, unexpected hosts, or dropped campaign tags. Then open the link in the browser or social app your audience uses and confirm the final page loads over HTTPS.

For a short link you received, the URL Expander can show the destination before you choose to navigate there. Look at the entire hostname, including the portion immediately before the suffix, and check whether it matches the service you expected. Learning the destination is one input to that decision. A site can still change what it presents based on time, device, or visitor.

Some pages send users onward via JavaScript or an HTML refresh. A server-side trace reports HTTP redirects, and a browser can see additional navigation after the page loads. If the final URL differs between your trace and browser, check the page source, your device, and where the client-side step enters the journey. Prefer a server response for permanent site moves when your hosting setup supports it. Google Search redirect guidance.

Test the site move before and after release

Build a redirect map keyed by the exact old address. Include the target, intended status, responsible team, and whether the destination should retain query values. For each high-value URL, keep a representative variant with a campaign tag or other expected parameter. A change that works for the bare path can still alter how people land after clicking an older email or ad.

Verify the new pages first. Check status, content, canonical URL, and whether a visitor can complete the purpose of the page. Test old URLs right after the release on a separate connection if possible. For long-running QR codes, scan a real code rather than typing what you think it contains. The QR tracking guide explains how a redirect can let you change what a printed code opens.

Check your Search Console indexing and sitemap reports after a permanent move. Look for important old URLs with unexpected statuses or destinations. Keep the map available to support staff so they can diagnose a link in an old receipt. Decide who can change the routing and where the previous settings live if you have to revert. Google Search site moves.

A canonical tag is a hint about the URL search engines should use. It does not take a visitor to another page. If someone must reach the new URL after typing the old one, verify there is a real redirect response. If the old page remains available because readers need it, choose canonical hints and links according to which copies are actually equivalent.

A temporary redirect can become a mess if nobody remembers when it was introduced. Write an expiry date in the ticket or redirect map and review it after the campaign. If the replacement later becomes permanent, update the status and point links directly at it. This is an operational decision as much as an SEO one.

A short link gives you a public address for sharing a campaign and measuring visits. Check where you can change its destination and which query parameters reach the final page. Before your next campaign, try a tracked LnkFlow link and trace it end to end.

Test the short link you plan to publish

Create a tracked link for your next campaign, then check where it lands and which campaign tags reach the destination.