Skip to content
Koit Academy

Websites & SEO

·

8 min read

301 vs 302 Redirect: Which to Use, and What Google Does

The difference between 301 and 302 redirects (and 307 and 308), how Google treats permanent and temporary moves, and which to use for common situations.

By Koit Academy

A redirect sends someone who asks for one address to another. The status code that comes with it says why, and the two most common codes say opposite things. A 301 says the page has moved for good. A 302 says it has moved for now and will be back. Browsers send visitors to the new address either way, so the difference is invisible to people. It is very visible to search engines, which decide from it which address to show in results.

Picking the wrong one is one of the most common reasons a page that moved never seems to carry its search traffic with it.

The four codes that matter

CodeNameMeaningRequest method kept?
301Moved PermanentlyThe page has a new permanent addressNot guaranteed; browsers may turn a POST into a GET
308Permanent RedirectSame as 301Yes
302FoundThe page is temporarily somewhere elseNot guaranteed
307Temporary RedirectSame as 302Yes

For ordinary web pages, which are requested with GET, 301 and 308 behave the same and so do 302 and 307. The method-preserving versions matter for form submissions and APIs, where turning a POST into a GET would lose the data being sent.

What Google does with each

Google’s documentation on redirects lists 301 and 308 as permanent and 302, 303 and 307 as temporary, and explains the difference in terms of which address it keeps:

  • Permanent: Google follows the redirect and treats it as a signal that the target should be canonical, so the new address is typically the one shown in results.
  • Temporary: the redirect does not carry that signal. Google generally keeps showing the source address, although the target might still be indexed if other signals point to it.

It recommends a permanent, server-side redirect whenever a page has moved for good, and describes server-side redirects as the ones it interprets most reliably.

Which to use, situation by situation

SituationUseWhy
A page’s address changed for good301The new address should replace the old in results
Moving a whole site to a new domain301Same, for every page
HTTP to HTTPS, or non-www to www301One permanent canonical version
Two pages merged into one301 from the retired pageIts links and visits belong to the merged page
A product temporarily out of stock, sent to its category302The product page will return
A page under maintenance for a few hours302 or 307The original address should stay in results
A form that posts to a moved endpoint307 or 308The POST data must be kept

The 301 redirect generator writes either kind for Apache, Nginx or a _redirects file, and warns when a 302 is chosen for what looks like a permanent move.

When a temporary redirect becomes a problem

A 302 left in place for months is the classic mistake. It usually happens when a developer uses a framework’s default redirect, which is often temporary, for what was meant as a permanent change. Google then keeps showing the old address, the new address struggles to rank, and the redirect quietly sits in the middle of every visit.

Search engines may in time treat a long-standing temporary redirect as permanent, but relying on that leaves the decision to them. If the move is permanent, say so.

What a redirect passes on

The worry behind most redirect questions is whether a page loses what it had built up: its links, its rankings, its place in results. For a permanent move done properly, Google’s guidance on site moves is reassuring: permanent redirects do not cause a loss in PageRank, and over time the new address takes the place of the old one in results. Expect some movement while that happens. Google says to expect temporary fluctuation during a move, and for a larger site the change can take weeks to settle.

What does lose value is the wrong kind of redirect or the wrong destination. A temporary redirect keeps the old address in results. A redirect to an unrelated page, such as every retired product sent to the home page, gives searchers something they did not ask for, and search engines can treat it much like a missing page.

Chains and loops

A chain is a redirect that leads to another redirect: /a to /b, then /b to /c. Each hop is another request for the browser and the crawler, and a long chain can be abandoned before it ends. A loop is a chain that comes back to where it started, and it never ends at all; browsers stop with an error.

Chains build up over time as pages move more than once. Each time a page moves, update the older redirects that pointed to its previous address so they point straight at the new one. The generator reports chains and loops in a list before you deploy it.

When not to redirect at all

Not every removed page needs a redirect. If a page is gone and nothing on the site replaces it, a 404 (not found) or 410 (gone) is the honest answer, and search engines drop the address from results once they see it. Redirecting such a page to something only loosely related helps nobody: the visitor lands somewhere they did not ask to go, and the destination gains nothing.

A redirect is right when there is a real successor: the same content at a new address, an updated version of an article, the product that replaced the discontinued one, or the category that held a retired product. The test is simple. Would the person who clicked the old link be glad to land on the new page? If yes, redirect. If not, let it return a 404, and make the 404 page useful, with a search box and links to the main sections.

Where to set redirects up

Redirects can be configured at several layers, and the closer to the request they run, the faster and more reliable they are.

  • At the server, in Apache’s .htaccess or Nginx’s configuration. Fast and reliable, if you have access.
  • At the host or content delivery network, through a _redirects file or a rules screen. Equally reliable, and often easier to manage for many rules.
  • In the content system, through a redirect plugin or setting. Convenient, but the request has to reach the application first, and a plugin that is switched off takes every redirect with it.

Whichever layer you choose, keep all redirects in one place. Rules split across a plugin, a server file and a host setting are hard to audit, and they are where chains and loops come from.

Redirects that are not 301s or 302s

Two other mechanisms are sometimes used to move visitors, and both are weaker:

  • Meta refresh, a tag in the page that sends the browser elsewhere after a delay. Google can follow an instant meta refresh, but a server-side redirect is clearer.
  • JavaScript redirects, which only work after the page has run its scripts. They are a last resort when the server cannot be configured.

After the redirect is live

A permanent redirect is the start of a move, not the end of it. Update internal links to point at the new address, update the sitemap to list only final addresses, and keep the redirect in place for at least a year. The full order of work is in how to change a URL without losing SEO, and the XML sitemap generator rebuilds the sitemap with the new addresses. If the move is a chance to tidy the address itself, the URL slug generator produces a clean slug from the page title.

Redirects in a site migration

A migration, such as a new domain, a move to HTTPS or a rebuilt site with a new structure, is where the choice of code matters most, because every address on the site changes at once. Every old address with a successor gets a 301 to it, not a blanket redirect to the home page. Internal links are updated so the site does not depend on its own redirects. The sitemap lists only the new addresses. And the redirects stay in place for at least a year, which is Google’s guidance for site moves, because links from other sites and old bookmarks keep arriving long after the move.

The choice in one sentence each

If the old address will never come back, use a 301 (or a 308 where a form or an API sends data). If it will come back, use a 302 (or a 307 for the same reason), and remove the redirect when it does. If there is no sensible destination, do not redirect; let the address return a 404 or 410. Everything else in this post is detail around those three sentences.

Checking what a redirect returns

The code a server sends is not always the one you intended. Open the old address with the browser’s developer tools on the Network tab, or use any HTTP header checker, and look at the status line of the first response. It should say 301 or 308 for a permanent move, and its Location header should be the final address, not another redirect.

Sources, read November 14, 2026:

  • Google Search Central, Redirects and Google Search: 301 and 308 as permanent and 302, 303 and 307 as temporary, how each affects which URL is shown, and the preference for permanent server-side redirects.