Portfolio
Services
Company
Contact Start a project

Websites · · 12 min read

A plain guide to the 301 vs 302 redirect: what permanent and temporary redirects do, what Google says about each and which to use when a page moves.

A redirect sends visitors and search engines from one address to another. The code it uses tells them whether the move is lasting or only for now.

A 301 redirect says a page has moved permanently, and a 302 says it has moved only for now. Google treats a permanent redirect as a signal that the new address should be the one it keeps, while a temporary redirect is not used that way. Use a 301 when the page has a new lasting address and a 302 when the original will come back.

What is a 301 redirect?

A 301 redirect, the permanent half of the 301 vs 302 redirect choice, is a server instruction saying that a page has moved permanently to a new address. When a browser or a search engine asks for the old address, the server replies with the code 301 and the new address. The visitor is passed on without clicking anything, and the address bar shows the new one.

The code is called "Moved Permanently", and the word permanent is the point. It tells everything that follows the redirect that the old address is retired and the new one should be used from now on. A related code, 308, carries the same message. Google's documentation says it treats 308 like 301, so for search purposes the choice between them rarely matters.

Google's guidance on redirects says a permanent server-side redirect is a strong signal that the new address should be the canonical one, meaning the address Google keeps in its index and shows in results. Google also states that permanent redirects do not cause a loss in PageRank.

What is a 302 redirect?

A 302 redirect says a page has moved temporarily. The server replies with 302 and a different address, the visitor is passed on, and the message to search engines is that the original address is still the real one and will be back. The standard names the code "Found", but in practice it means a temporary move.

Google's documentation says it follows temporary redirects but its indexing system does not use them as a signal that the target should be the canonical address. The target can still end up indexed if other signals point to it, which is one more reason to use the code that matches what you mean. The twin code, 307, is treated like 302.

301 vs 302 redirect at a glance

Question301 (permanent)302 (temporary)
What it saysThe page has moved for goodThe page has moved for now
The old addressRetiredExpected to return
How Google treats itA strong signal that the new address should be canonicalFollowed, but not used as a signal that the new address should be canonical
Typical useRenamed pages, a new domain, HTTP to HTTPS, merged pagesShort campaigns, tests and temporary swaps
Twin code308307
When to remove itKeep it for as long as you canRemove it when the temporary reason ends

If the table gives one rule, it is to pick the code that matches your intention. Search engines act on what the code says and not on what you meant.

Which redirect should I use when I move a page?

Ask whether the old address will ever be used again. If it will not, use a 301. If the original page is coming back, use a 302. Most page moves on a business website are permanent, so 301 is the usual answer. The table covers the common cases.

SituationRedirectWhy
You change a page's address, for example by moving it into a different section of the site301The old address is retired
You merge two pages, or rename one301, from each old address to the page that now covers itVisitors and links reach the right content
You change your domain name301, from every old page to its matching page on the new domainThe whole site has moved for good
Your site moves from HTTP to HTTPS301Google's HTTPS guidance recommends 301 redirects for this
You settle on one version of your address, with or without www301, from the other versionEach page ends up with one address
A seasonal offer page replaces the usual page for a while302The usual page returns
You test two versions of a page at different addresses302Google's testing guidance says to use 302, not 301, for this
A page is gone and nothing similar existsNo redirectAn honest error page serves visitors better than an unrelated destination

A common real case is the About page. Businesses often rewrite it and change its address at the same time, perhaps when a long history page becomes a short one. The guide to writing an About us page covers what the page should say. If its address changes, a 301 from the old address keeps old links and bookmarks working.

HTTP to HTTPS and www: the redirects every site has

Two permanent redirects matter on most sites before any page has moved: one for HTTP to HTTPS and one for the choice of www or no www. A site can usually be reached at four addresses: with and without www, each over HTTP and over HTTPS. Each of the four should end at the one address you have chosen, through a 301.

Google's HTTPS guidance recommends 301 redirects to send visitors from HTTP to HTTPS. What a certificate is, and what to do when one is missing or expires, is covered in the guide to HTTPS and SSL certificates. For the www question, the choice between the two versions matters less than being consistent. Pick one, redirect the other to it, and use the chosen version in your links, sitemap and printed material.

Test all four variants of the home page by typing them in. If any of them stops at a different address or shows a warning, fix it before anything else.

What Google says about redirect types

Google's redirect documentation ranks the ways of redirecting by how reliably Google can interpret them. A server-side redirect, the 301 and 302 described here, comes first and is the one to use wherever you can.

If you cannot set a server-side redirect on your platform, a meta refresh is the next option. Google treats an instant meta refresh as permanent and a delayed one as temporary. A JavaScript redirect comes last. Google says to use it only if the other two are impossible, because rendering can fail and Google might never see the redirect.

On chains, where one redirect leads to another, Google follows them only up to a limit and advises sending the old address straight to its final destination. For site moves, Google recommends permanent server-side redirects and keeping them in place for as long as possible.

How redirects affect visitors

A redirect is invisible when it works, but it is not free. The browser has to make one extra request before the page can load, and every extra step in a chain adds to the wait. One redirect is rarely noticeable. Three in a row on a slow connection can be.

Check redirects on a phone as well as a computer. Some older sites send phone visitors to a separate mobile address through a redirect, and a common fault is that the visitor lands on the home page and not on the page they asked for. A design that serves one address to every device avoids the problem, and the guide to making a website mobile-friendly covers the other checks worth running.

Update your own links as well. A redirect is a safety net for links on other sites, bookmarks and search results. Your menu, buttons and text links should point to the new address directly so that your own visitors do not pass through a redirect at all.

Where redirects are set up

Where you set a redirect depends on how the site is built and hosted. The usual places are the web server's configuration, the hosting control panel, a setting or add-on inside the content management system, a rule at a content delivery network, or the site's own code.

What you can reach depends on the type of hosting. On some plans you can edit server rules yourself, and on others you can only use the control panel or a plugin. The guide to types of web hosting explains the differences. If you are unsure, ask the host or developer where redirects live and who is allowed to change them.

The job is easy to get wrong in bulk. If a rebuild changes many addresses, write the old and new addresses in a two-column list, have the developer load them, and test a sample. A team that builds sites, such as the one described on the website development service page, should be able to say how it handles redirects before a launch.

Common redirect mistakes

Most redirect problems come from picking the wrong code or from leaving a redirect untended.

  • Using a 302 for a lasting move and forgetting it. The code says the original will return, so search engines may keep treating the old address as the real one.
  • Using a 301 for something temporary. Browsers can remember a permanent redirect, so returning visitors may keep being sent to the wrong place after you remove it.
  • Sending every old page to the home page. The visitor wanted a particular page, and Google may treat many such redirects as soft 404 errors.
  • Building chains and loops. Point each old address straight at the final one. A loop, where addresses redirect to each other, shows visitors an error.
  • Leaving your own links pointing at the old address, so every click pays for an extra step.
  • Blocking the old address in robots.txt. A crawler that is not allowed to fetch the address cannot see the redirect on it.
  • Removing redirects too soon, while links and bookmarks to the old address are still in use.

How to check a redirect

  1. Open a private browser window, so a remembered redirect does not hide what the server does now.
  2. Type the old address. Check that you land on the intended page in a single step and that the address bar shows the new address.
  3. Look at the status code. The Network panel in the browser's developer tools shows whether the first reply was 301 or 302, and a developer can read it with a command-line tool.
  4. Repeat for the four home page variants described above, then for a sample of the other changed addresses.
  5. Repeat on a phone.
  6. After launch, open the page indexing report in Google Search Console. Addresses that redirect appear as "Page with redirect", which is informational and not an error. A status named "Redirect error" covers chains that are too long, loops and bad destinations. Check the current documentation for the exact labels.

When a redirect is not the right tool

A redirect suits a page that has a successor. If a page is gone and nothing similar exists, leave it as an error page and take down the internal links to it. Google treats a 404 on an address that should not exist as normal.

A redirect is also the wrong tool when two addresses must both stay reachable for visitors, but you want search engines to prefer one. That is the job of a canonical tag, which names the preferred version without moving anyone. Google lists redirects and canonical tags as separate signals, so match the tool to the situation.

Questions and answers

What is a 301 redirect?

A 301 redirect is a server reply that says a page has moved permanently to a new address. Visitors are passed on automatically, and Google treats it as a strong signal that the new address should be the one kept in its index. Use it when the old address will not come back.

What is a 302 redirect?

A 302 redirect says a page has moved temporarily. Visitors are passed on, but search engines are told the original address is still the real one. Google follows temporary redirects without using them as a signal that the target should be canonical.

Which one should I use when I move a page?

Use a 301 if the move is lasting, which is true for most business websites: renamed pages, merged pages, a new domain or a move to HTTPS. Use a 302 only when the original page will return, such as for a short campaign or a test.

Is a 302 redirect bad for SEO?

A 302 is not bad when it is used for a temporary move. The trouble comes when a lasting move is left as a 302, because the code says the original will return. Google does not use a temporary redirect as a signal that the target should be canonical.

What is the difference between 301 and 308, or 302 and 307?

Google treats 308 like 301 and 307 like 302, so for search the pairs are equivalent. The newer codes differ in how they handle form submissions, which matters mainly for web applications. For ordinary pages, 301 and 302 are the usual choices.

What is a redirect chain and why avoid it?

A redirect chain is a series where one address redirects to another, which redirects to a third. Each step adds a request and a delay, and Google follows chains only up to a limit. Send each old address straight to its final destination.

How do I check which redirect a page uses?

Open the old address in a private window and watch where you land. For the status code, use the Network panel in your browser's developer tools or ask a developer to check with a command-line tool. Search Console also lists redirecting addresses in its page indexing report.