A 301 redirect tells the browser and the search engine that an address has permanently moved to a new location. Google then transfers the signals from the old address to the new one and swaps it in the index. A 302, on the other hand, means "temporary" and only applies to actions that will end again. If you change addresses, merge pages or rebuild your website, you need a 301 from every old address to the matching new page, without chains and not just a blanket redirect to the homepage.
Every address that has ever appeared on Google has value: it's indexed, perhaps linked to, perhaps saved as a bookmark. If you change it without redirecting, you throw away that value and show visitors an error page. The 301 redirect is the tool that carries that value across.
301, 302, 307, 308: which one when
A redirect is a response from the server: "The page isn't here, go there." The status code says whether this is permanent.
| Code | Meaning | Use case | |
|---|---|---|---|
| 301 | Permanently moved | Swaps the old address for the new one in the index, transfers signals | Address changed, pages merged, domain change, http to https, www variant |
| 308 | Permanently moved, request type stays the same | Same as 301 | Same effect, default on Vercel and some hosting providers |
| 302 | Temporary | Keeps the old address in the index | Promotion page for two weeks, maintenance page, A/B test |
| 307 | Temporary, request type stays the same | Same as 302 | Same effect |
The rule of thumb: if the old address will never be needed again, use 301. If it's coming back in the foreseeable future, use 302. The most common mistake is using a 302 for a permanent move because the plugin or hosting provider sets it as the default. Google states that it eventually treats long-standing 302 redirects as permanent ones, but you shouldn't rely on that.
When you need to redirect
- A post's address changes, for example because the title was updated.
- Two pages are merged into one, for example in the case of duplicate content.
- A page is deleted and has a content successor.
- The website moves to a new domain or from http to https.
- The spelling with or without www is standardised; the other variant redirects.
- During a relaunch, the structure changes, for example from /blog/2023/05/title/ to /guide/title/.
Redirects and canonical tags complement each other: the redirect ensures that only one address is reachable, the canonical tag provides a safety net in case a variant slips through anyway.
Avoiding chains and loops
A chain forms when A redirects to B and B later redirects to C. After a second relaunch, three or four steps aren't unusual. According to its documentation, Google follows up to ten redirects in a row, but each step costs time, and with long chains the crawler gives up. Visitors notice it in the loading time. So:
- Whenever you set up a new redirect, check whether the old address is already the target of a redirect. If so, point the older one directly at the new target: A to C instead of A to B to C.
- Before a relaunch, export the existing redirect list and update all targets to the new addresses.
- Loops (A to B, B to A) usually result from www or https rules that trigger each other. The page then doesn't load at all; opening it in a browser shows this immediately.
The relaunch in brief
A relaunch is the moment when most redirects go missing. The minimum plan:
- Before the rebuild, export all existing addresses, from the sitemap and from the performance report in Search Console.
- For every old address, note the new equivalent in a table, one to one. No blanket redirect to the homepage.
- Set up redirects before going live and check them on the test environment.
- After going live, visit the twenty most important old addresses by hand.
- Resubmit the sitemap, with new addresses only.
The full checklist with everything else worth checking is at Website relaunch without losing visibility.
Setting up: WordPress and Vercel
In WordPress, there are two ways. First, a redirect plugin that takes old and new addresses per entry and often creates a redirect automatically when a post address changes. Second, the .htaccess file on the server (for Apache), one line per redirect:
Redirect 301 /alter-beitrag/ https://www.beispiel.ch/neuer-beitrag/
For websites on Vercel, the rule sits in the vercel.json file in the project:
{ "redirects": [ { "source": "/alter-beitrag", "destination": "/neuer-beitrag", "permanent": true } ] }
With permanent: true, Vercel responds with 308, which Google treats like a 301. On Wix and Shopify, you'll find redirects in the SEO settings as a simple old-to-new list.
Review
- Call up the old address in the browser: do you land on the correct new page, without any stops in between?
- Read the status code in the terminal with
curl -I https://www.beispiel.ch/alter-beitrag/: 301 or 308, and the correct target in the "location" line. If the target itself shows another 301, you've got a chain. - Run the URL inspection on the old address in Search Console: it should show up as "page with redirect". In the "Pages" report, no 404 entries for the old addresses should appear after a few weeks.
- Switch internal links to the new addresses, so not every click goes through the redirect.
What to do with this
Keep a table of all redirects, with date and reason. Add an entry for every address change, and check it against every relaunch. Once a year, check Search Console to see if 404 errors appear for addresses that once had visitors: each one is a missing redirect.
Frequently asked questions
Does a page lose ranking through a 301 redirect?
Google has stated that no signals are lost with a 301 if the target matches the content. In practice, it can still take weeks for the new address to reach the old position, because Google has to reassign the signals first. Losses mainly happen when the target doesn't match or the redirect is missing.
How long does a redirect need to stay in place?
For website moves, Google recommends keeping redirects for at least a year. Permanent is better, because external links to the old address are never updated. Redirects cost nothing, so only delete them once you're sure nothing points to them any more.
What's the difference between 301 and 308?
Both mean permanent. 308 additionally requires that the request type is kept, which matters for forms. For Google, both are equivalent; Vercel and other platforms use 308 by default for permanent redirects. You don't need to change anything.
Should I redirect deleted pages to the homepage?
No. Google often treats redirects whose target has nothing to do with the old page like a 404. Redirect to the closest matching page instead: the successor post, the relevant service page, the category. If there's nothing suitable, an honest 404 is better than a misleading redirect.