# What Is a 301 Redirect and When to Use It in a Store

> What a 301 redirect is, how it differs from a 302 or a 308, what Google does with it and how to redirect a product page that changes URL on Shopify.

URL: https://clione.ai/glossary/301-redirect/
Lang: en

A 301 redirect is what keeps an old link from ending in "page not found." In a store you need it more often than it seems: a product changes its name and with it its URL, a [product page](/glossary/product-page/) is discontinued, two categories merge, the store changes platform. It has nothing to do with the redirection of an affiliate link: it is a server response with a specific code. For the buyer, the difference between a 301 and a 404 is arriving or not arriving. For Google, **the redirect says which URL it should show from now on**, and that is why a badly placed 301 gets paid for in [indexing](/glossary/indexing/).

## How it works

The 301 code is defined by the HTTP standard, today RFC 9110, published in 2022: the resource has moved to a new, permanent URL, and the client should use that address in its future requests. The new URL travels in the `Location` header, and the response **can be cached even if nobody says so**.[^rfc9110] The same standard defines its relatives. The 308 is also permanent, but it requires repeating the request with the same method, so a submitted form is still a submission, whereas with a 301 the client may change a submission into a plain page request. The 302 and the 307 are temporary: they do not say the resource has moved.[^rfc9110]

Google groups redirects by what they mean to it, not by number:[^google-redirects]

| Type      | How it is done                                                        | What Google does                                                                                                           |
| --------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Permanent | 301, 308, `meta refresh` at 0 seconds, a JavaScript `location` change | Follows the redirect, takes the destination as the URL that should be canonical and shows it in results[^google-redirects] |
| Temporary | 302, 303, 307, `meta refresh` of more than 0 seconds                  | Keeps the origin URL in results; the destination can be indexed if other signals support it[^google-redirects]             |

That signal is the same one the [canonical](/glossary/canonical-url/) tag pursues: that a single URL counts. Google prefers redirects done on the server and leaves JavaScript ones for when there is no other option, because if rendering fails it may never see them. And it warns of an effect that throws people off: **the old URL can keep showing for a while as an alternate name** after a permanent redirect, and stops on its own over time.[^google-redirects]

In [Search Console](/glossary/google-search-console/), the old URL appears in the indexing report as "Page with redirect": a non-canonical page that redirects to another and will not be indexed. The destination may or may not be indexed, depending on what Google thinks.[^gsc-page-indexing] The redirect picks the URL; it does not guarantee the destination makes it into the index.

When what changes is many URLs at once, Google's migration guide adds three rules. Keep redirects **as long as possible, generally at least a year**. Keep chains short: ideally no more than 3 hops, and fewer than 5. And do not send many old URLs to a single destination unrelated to them, such as the homepage, because it confuses people and can be treated as a _soft 404_ error. A small or medium site can take a few weeks to see most of its pages on the new URLs, and a large one longer.[^google-site-move]

## In a store

A **fictitious example**: a tea store renames a teapot and with it its URL. This is how the old address responds when viewed with `curl`, which shows the response without following the redirect:

```text
$ curl -I https://store.example/products/iron-teapot-06l
HTTP/2 301
location: https://store.example/products/cast-iron-teapot-06l
```

Two lines are enough: the code says the change is permanent and `location` says where to. What they do not say is whether the destination is the right one, and that decision is made URL by URL:

| What happened (fictitious example)            | Old URL                           | Response                                                                            |
| --------------------------------------------- | --------------------------------- | ----------------------------------------------------------------------------------- |
| The teapot is renamed                         | `/products/iron-teapot-06l`       | 301 to the new URL of the same product                                              |
| A tea is discontinued and has a successor     | `/products/sencha-2025`           | 301 to the successor's page                                                         |
| A tea is discontinued with nothing equivalent | `/products/limited-edition-tea`   | A 404; sending it to the homepage can be treated as a _soft 404_[^google-site-move] |
| Two categories merge                          | `/collections/japanese-green-tea` | 301 to the collection that brings the two together                                  |

On Shopify, redirects are created from the menus section of the admin (_Content › Menus › View URL Redirects_), one by one or by importing a CSV, and they take effect immediately. Three platform rules change what you can do. **You can only redirect from a broken URL**, one that shows "page not found" or a 404: if the old page is still published, the rule does not work. You cannot redirect the fixed paths `/products`, `/collections` and `/collections/all`, nor those that start with prefixes such as `/cart`, `/orders` or `/apps`. And the maximum is 100,000 redirects, or 20,000,000 on the Plus plan. Shopify also warns that URLs with parameters may not work as expected, and that **browsers and search engines cache 301s**: if you delete one that has already been used, it may keep working for that person until it expires.[^shopify-redirects]

When you change the handle of a [Shopify collection](/glossary/shopify-collection/), the admin offers a checkbox to create the redirect from the previous URL, so that anyone arriving by an old link does not end up on a 404. Shopify also asks you not to change the handle often, because the collection could stop appearing in search engine results.[^shopify-collection-settings]


**Sending everything that disappears to the homepage seems prudent, and it is not.** Google asks you not to redirect many old URLs to a single destination unrelated to them, such as the homepage of the new site: it confuses whoever arrives and can be treated as a _soft 404_, that is, as if the page did not exist.[^google-site-move] A redirect makes sense when the destination answers what whoever asked for the old URL was looking for; if there is nothing equivalent, the 404 is the honest response.


## How to check it

1. **Request the old URL with `curl -I`** and look at the first two lines: the code has to be 301 or 308, and the `Location` header has to carry the destination URL.[^rfc9110] A 302 or a 307 tells Google the change is temporary.[^google-redirects]
2. **Follow the whole chain** with `curl -sIL` and count the hops. The ideal is 3 or fewer, and never 5 or more.[^google-site-move] If the URL has changed several times, make all the old ones point directly to the last one.
3. **Open the destination** and check that it responds with a 200 and that it is the same product or its replacement, not the homepage or a generic category.[^google-site-move]
4. **Update the [internal links](/glossary/internal-linking/) and the [XML sitemap](/glossary/xml-sitemap/)** so they point to the new URL. Google asks you to replace in your own links all the URLs that change and to submit the new sitemap in Search Console.[^google-site-move]
5. **Inspect both URLs in Search Console.** The old one should show as "Page with redirect" and the new one, in time, as indexed.[^gsc-page-indexing]

## Related concept: 302 redirect

The 302 is the temporary redirect, and it gets confused with the 301 because for the person browsing there is no difference: both take them to the destination. For Google there is. With a permanent one, it shows the destination in results; with a temporary one, it **keeps the origin URL in results**, and the destination is only indexed if other signals support it.[^google-redirects] The rule is the standard's: the 302 is for a resource that is somewhere else for a while and will come back; the 301, for one that has moved.[^rfc9110] A renamed page is not going back to its old URL, so its redirect is a 301. If both URLs have to stay open, for example a product page seen from within a collection, the tool is a different one: the canonical, which redirects no one.

To go further, the entry on [crawling vs indexing](/glossary/crawling-vs-indexing/) explains why a redirected URL is crawled but not indexed, and the [crawling and indexing reading path](/learn/crawling-and-indexing/) orders the rest of the terms.
