Skip to content
Desayuno SEO

301 redirect: what it is and when to use it on your website

· Published: ·Technical SEO

Translated from the Spanish original. Leer en español

Alejandro in a red t-shirt holds a wooden signpost and points to the new address. Headline: Redirect 301.

You change the address of a page and, one day, someone writes to you: "your link is broken". You already knew. What you don't remember is whether you left a note on the door of the old house.

A 301 redirect is that note. It tells people and Google that a page has moved permanently to another address. According to Google's documentation on redirects, a permanent redirect tells Google that the target should be the canonical URL and the one to show in results.

Short answer: use a 301 when a page changes address for good and an equivalent destination exists. If the change is temporary, it is not a 301, it is a 302. And if there is no equivalent destination, don't use one.

What is a 301 redirect and what does it tell Google?

It is a server response. Someone asks for the old URL, the server answers "this is now at this other address" and the browser jumps there on its own. The person barely notices.

Two miniature shops, an old closed one and a new open one, with a wooden arrow and a moving box between them
A 301 redirect says the page has moved for good. Conceptual illustration.

Google does notice, and the type matters. With a permanent redirect, indexing takes it as a signal that the target is the canonical URL. With a temporary one it does not, and the source page may keep showing in results.

The usual worry is whether strength gets lost on the way. Google says it in its site move guide: 301 and other permanent redirects do not cause a loss of PageRank.

When should you use a 301 redirect?

Google lists four common situations in its redirects documentation:

  • You have moved your site to a new domain.
  • The same page can be reached at several addresses (with and without www, http and https) and you want to leave one as the preferred version.
  • You are merging two sites and want old links to land on the right page.
  • You have deleted a page and want to send people to another one that replaces it.

To those four I add one more, the one I run into most often: two pages on your own site competing for the same thing. If you merge their content, the page that disappears should point to the one that stays. How to spot it is in SEO cannibalization.

And before changing an address, ask yourself whether it was needed. A well-planned URL from the start saves you the redirect. You have it in friendly URLs.

301, 302 or 308? What changes for Google

For the person browsing, there is almost no difference. For Google, there is. This table sums up what its documentation says:

What we look atPermanent: 301 and 308Temporary: 302, 303 and 307
What Google doesFollows the redirect and takes it as a signal that the target is the canonicalFollows the redirect, but does not take it as a signal that the target is the canonical
What it usually showsThe new destination in resultsThe source page in results
When it fitsWhen you are sure you will not revert itWhen it is something passing, such as a service unavailable for a few days

If you cannot see all the columns, scroll the table sideways.

Two wooden signposts with arrows: one nailed in place next to a sealed box and one with a loose note next to an open suitcase
Permanent move versus temporary change. Conceptual illustration.

Google treats 301 and 308 as permanent. Between them, for the search engine, there is no difference that forces you to choose carefully.

There are other ways to redirect. An instant meta refresh (0 seconds) is read as permanent, and one with a delay as temporary. JavaScript redirects, Google asks you to keep for when you cannot do it on the server, because if rendering fails it may not even see them.

My rule so I never doubt: will you undo it? If the answer is no, 301.

How do you migrate URLs without losing what you already earned?

The typical mistake is not technical, it is a mapping mistake. Redirects get done by eye and later you find that half of them point to the home page. With Google's migration guide at hand, this is the order I would follow:

  1. List the old URLs and decide the destination of each one. A map from old to new, in a spreadsheet.
  2. Redirect each page to its equivalent. Don't send many old URLs to a single irrelevant destination, such as the home page: Google warns that it can confuse and be treated as a soft 404. If you have merged several pages into one, then it does make sense to redirect them all to that one.
  3. Use permanent server-side redirects (301 or 308), which is what Google recommends.
  4. Update your own internal links, canonicals and sitemap to the new URLs.
  5. Test it: the URL Inspection tool in Search Console for one page, or a crawl with Screaming Frog if there are many.
  6. Keep the redirects for as long as possible, at least a year according to Google, so it can transfer all the signals.

One reassuring detail: even if everything is done right, Google may still show the old address from time to time. It calls them "alternative names" and they fade out on their own.

What are redirect chains and loops?

A chain is when A redirects to B, B redirects to C and C is finally the page. Googlebot can follow up to 10 hops, but Google advises going straight to the final destination. If that is not possible, keep the chain short: ideally no more than 3 hops and fewer than 5. Every hop adds waiting time for the visitor.

Three wooden arrow signposts sending you from one to the next in a circle, with a wooden figure walking around without arriving
A redirect chain can end in a loop. Conceptual illustration.

They usually appear when you change the same URL twice. The first redirect still points to the intermediate version and nobody touches it. The fix is boring and it works: edit the old rule so it points to the latest address.

A loop is worse: A leads to B and B goes back to A. Nobody gets anywhere and the browser ends with an error. They can appear when you add new rules without reviewing the ones you already had.

To find them on your site, crawl with Screaming Frog and check the redirect reports. You have the step by step in Screaming Frog to audit your site.

What if you delete a page and there is no equivalent?

Don't invent a destination. A 301 to something that has nothing to do with the original page is exactly the case Google advises against. If there is no substitute, the right answer may be a 404 or a 410. When each one fits I cover in error 404: when to fix it and when to leave it alone, without repeating it here.

My criterion: two pages, only one wins

On this very site I had two pages with the same search intent: the web positioning page and the home page. Google chose the home page for the same queries. I decided to delete the second one, send it with a 301 to the home page, and strengthen the content there.

I am not telling you results because it is still early. I am telling you the criterion: two URLs for the same thing get in each other's way, and a 301 makes clear which one stays.

5-minute checklist before launching a redirect

  1. Is there an equivalent page to send people to? If not, think 404 or 410.
  2. Is it permanent? If you are not going to undo it, 301 or 308.
  3. Does it go straight to the final destination, with no intermediate hops?
  4. Have you changed your internal links, canonicals and sitemap to the new URL?
  5. Have you tested it in Search Console or with a crawl?

Frequently asked questions about 301 redirects

Does a 301 make you lose rankings? Google says permanent redirects do not cause a loss of PageRank. A different matter is when the target is not equivalent to the content that used to rank.

How long do I keep it? At least a year, according to Google. And if you can, longer: from the visitor's point of view, keeping them indefinitely is reasonable. What does help is changing your own links to the new URL, because every redirect is a little slower.

301 or canonical? With a 301 the person also ends up on the new page. With a canonical, both pages stay accessible and you only tell Google which one you prefer. The differences are in what a canonical is.

How do I create one? It depends on your server. On Apache, Google gives this example with mod_alias: Redirect permanent "/old" "https://example.com/new". On Nginx, return 301 with the new address. In PHP, the HTTP/1.1 301 Moved Permanently header together with Location. If you use WordPress, Shopify or another platform, check first how it handles this.

If you are going to move a whole site and don't want to gamble, you can see how I work on technical SEO.

To finish the coffee

A 301 is a note on the old door: permanent, direct, and pointing to a house that exists. If the note leads to an empty lot or goes around three times before arriving, better not to write it.

Tomorrow, another Desayuno SEO. I have already picked the next topic: SEO for ecommerce, where to start if you run an online shop. In Spain it is searched about 1,000 times a month, according to Semrush. If you sell online, it is for you.

More editions

See all editions

Tell me about your project

The first call is free and with no commitment. I tell you what I would do on your site and whether it makes sense to work together.