301 redirects send visitors and search engines from an old URL to a new one, and tell Google the move is permanent. Get them right and a new website, a renamed product or a domain change keeps its rankings and links. Get them wrong and you lose traffic you spent years building. This guide covers 301 vs 302, 307 and 308, when to use each, how to avoid chains and loops, and how to set redirects up in WordPress, Shopify and Cloudflare. If you are planning a rebuild, our web design team builds redirect mapping into every project, and our ecommerce SEO agency handles migrations for existing shops.
Technical details below come from Google Search Central, Shopify Help Centre and Cloudflare documentation, checked in November 2026.
Quick Answer
Use a 301 (or 308) redirect when a page has moved for good. Use a 302 (or 307) only when the move is temporary and the old URL will come back. Point every old URL straight to its closest new equivalent in one hop, not via a chain. Keep redirects in place for at least a year; Google's John Mueller has said this. Set them up on the server or platform (a WordPress plugin or .htaccess, Shopify URL redirects, or Cloudflare redirect rules), not with JavaScript or meta refresh.
In this post
Planning a new site or platform move?
Talk to us before launch. We will map every old URL that has traffic or links, so your rankings move with you.
What Is a 301 Redirect?
When a browser or crawler asks for a URL, the server replies with a status code. A 301 Moved Permanently reply says: this page now lives at a different address, go there instead, and update your records. Visitors are taken to the new page automatically. Google treats the new URL as the one to index.
Google's documentation on HTTP status codes says a 301 is a strong signal that the redirect target should be the canonical (main) URL. Content on the old URL is ignored and the target page's content is processed instead.
301 vs 302 vs 307 vs 308
| Code | Name | Meaning | How Google treats it |
|---|---|---|---|
| 301 | Moved Permanently | The page has moved for good | Strong signal that the target is canonical |
| 308 | Permanent Redirect | Permanent, and the request method must not change | Treated the same as a 301 |
| 302 | Found | Temporary move | Weak signal that the target is canonical |
| 307 | Temporary Redirect | Temporary, and the request method must not change | Treated the same as a 302 |
| Meta refresh | HTML tag | Browser redirect after a delay | Google advises a server-side 301 instead |
| JavaScript | Script | Redirect in the browser | Only seen after rendering. Use only if server redirects are impossible |
For SEO, 301 and 308 behave the same, and 302 and 307 behave the same. Google's documentation still asks you to use the code that matches the real meaning, because other search engines and tools may treat them differently. For a permanent move, 301 is the safe, widely supported choice. Google's page on supported meta tags also recommends a server-side 301 over a meta refresh.
A common mistake: using a 302 for a permanent change because it was the default in a plugin or platform. Over time Google may work out what you meant, but you are sending a weaker, mixed signal. If the old page is never coming back, use a 301.
When to Use a 301 Redirect
- You change a URL. A product handle, a blog slug or a category path changes.
- You delete a page that has a close replacement. A discontinued product with a newer model, or two thin collections merged into one.
- You move platform. WooCommerce, Magento or Wix to Shopify, for example, where URL structures change.
- You change domain. A rebrand, or moving from .com to .co.uk.
- You standardise versions. http to https, and non-www to www (or the reverse), so only one version of each page exists.
- You clean up duplicates. Old campaign pages or near-identical articles that compete with each other.
When not to use a 301
- Short-term stock outages. Keep the product page live with a clear "back soon" message and alternatives. Redirecting and un-redirecting confuses Google and customers.
- Seasonal pages that return each year. Keep one evergreen URL, such as /black-friday/, and update it, rather than redirecting each year's version.
- No relevant replacement. If nothing similar exists, a 404 or 410 page with good navigation is more honest than sending everyone to the home page, where visitors cannot find what they wanted.
- A/B tests. Use 302 for temporary test redirects, so the original stays canonical.
Redirect Chains and Loops
A chain is when URL A redirects to B, which redirects to C, and so on. Chains build up over the years as sites are rebuilt: an old http page redirects to https, which redirects to a renamed page, which redirects to the new platform URL.
Google's documentation says its crawlers follow up to 10 redirect hops. Beyond that, the URL can fail. Even before that limit, every hop slows the page for visitors and wastes crawling. A loop is worse: A redirects to B and B redirects back to A. The page never loads and browsers show an error.
| Setup | Hops | Fix |
|---|---|---|
| http://yourshop.co.uk/old → https://yourshop.co.uk/old → https://www.yourshop.co.uk/old → https://www.yourshop.co.uk/new | 3 | Redirect every version directly to https://www.yourshop.co.uk/new |
| /sofa-a → /sofa-b → /sofa-a | Loop | Delete one rule and point both to the live page |
Good practice: after any migration, crawl your list of old URLs with a tool such as Screaming Frog in list mode. Every old URL should return one 301 to a page that returns 200. Then update internal links, menus and your sitemap to point straight to the new URLs, so visitors and Google do not hit redirects at all.
How to Set Up 301 Redirects in WordPress
Option 1: a plugin
For most WordPress sites, a plugin is the safest route. Rank Math has a built-in Redirections module, and the free Redirection plugin is widely used. Both let you:
- add a source URL and a target URL, and choose 301;
- import redirects in bulk from a CSV file;
- log 404 errors so you can spot missing redirects;
- see how often each redirect is used.
Some SEO plugins can also create a redirect automatically when you change a post's slug. Check that this is switched on before you rename pages.
Option 2: .htaccess on Apache servers
Many UK shared hosts run Apache or LiteSpeed, which read a file called .htaccess in the site root. Adding redirects here runs them before WordPress loads, which is slightly faster. Always back up the file first; one typing error can take the site offline.
# Single page
Redirect 301 /old-page/ https://www.yourshop.co.uk/new-page/
# Whole folder, keeping the rest of the path
RedirectMatch 301 ^/blog/(.*)$ https://www.yourshop.co.uk/news/$1Place your own rules above the # BEGIN WordPress block so WordPress does not overwrite them. If your server runs Nginx, .htaccess does nothing; redirects go in the server configuration or your host's control panel instead.
Do not mix methods without a record
Redirects spread across a plugin, .htaccess, the host panel and Cloudflare are hard to debug and easily create chains. Keep one master spreadsheet of every redirect and where it lives.
How to Set Up URL Redirects in Shopify
Shopify's URL redirects help page explains the process:
- In Shopify admin, go to Content, then Menus, then View URL redirects.
- Click Create URL redirect.
- Enter the old path in Redirect from (for example /products/old-name) and the new path in Redirect to.
- Save. The redirect works straight away.
For many URLs, use Import and upload a CSV file. Shopify provides a template. Key points from Shopify's documentation:
- Redirects only work from broken URLs. If a live page still exists at the old address, the redirect will not fire. Delete or unpublish the old product or collection first.
- Limits: up to 100,000 redirects per store, or up to 20,000,000 on Shopify Plus.
- Some paths cannot be redirected, such as /products, /collections, /collections/all and paths starting /cart or /orders.
When you edit a product or collection's URL handle in the search engine listing section, Shopify shows a tick box to create a redirect from the old URL. Leave it ticked. Our Shopify SEO guide covers the rest of Shopify's URL structure.
A common mistake on Shopify: deleting discontinued products and doing nothing. Each one becomes a 404, and any links or rankings it had are lost. Redirect it to the replacement product or the most relevant collection.
Cloudflare Redirect Rules
If your domain runs through Cloudflare, you can redirect at Cloudflare's edge before the request reaches your server or platform. This is useful for domain moves, old subdomains and URLs your platform cannot redirect. Cloudflare's URL forwarding documentation describes two tools:
| Tool | Level | Best for | Free plan limit |
|---|---|---|---|
| Single Redirects | One domain (zone) | Pattern rules, such as redirecting a whole old domain or folder | 10 rules |
| Bulk Redirects | Whole account | Long lists of fixed old-to-new URLs | 10,000 URL redirects across lists |
Both need the domain's DNS records to be proxied through Cloudflare (the orange cloud). Regex matching in Single Redirects needs a Business plan or above. Choose 301 as the status code for permanent moves.
Domain move example
A brand moving from oldbrand.co.uk to newbrand.co.uk can add one Single Redirect on oldbrand.co.uk that sends every request to the same path on newbrand.co.uk with a 301. That keeps deep links working, not just the home page.
301 Redirects in Site Migrations
Most lost rankings after a new website come from missing or lazy redirects. Follow this order:
- Export every old URL. Use your sitemap, a site crawl, Google Search Console's Performance report (pages with clicks or impressions), Google Analytics landing pages and your backlink tool. Shopify and WooCommerce product exports help too.
- Map each old URL to its closest new URL. Product to product, category to category, article to article. Do this in a spreadsheet.
- Avoid mass redirects to the home page. Send old URLs to relevant pages only.
- Load and test before launch on the staging site, where possible.
- Launch and crawl the old URL list. Every row should return a single 301 to a live page.
- Update internal links, menus, canonicals and sitemaps to the new URLs.
- For a domain change, use Google's Change of Address tool in Search Console after the redirects are live.
- Watch Search Console for 404s and indexing changes for several weeks.
- Keep the redirects. Google's John Mueller recommended keeping redirects in place for at least one year, as Search Engine Journal reported. If old URLs still have links or traffic, keep them for longer.
Our technical SEO checklist lists the other launch checks, and our WordPress vs Shopify comparison helps if you are still choosing a platform.
Why UK Ecommerce Brands Choose Growth Pulse Media
We have rebuilt and migrated shops on Shopify and WordPress, and we treat redirect mapping as part of the build, not an afterthought. Every web design project includes an old-to-new URL map, launch-day testing and a Search Console check in the weeks after. For live shops, our ecommerce SEO agency team cleans up chains, 404s and redirect sprawl as part of technical SEO.
Web design starts from £3,000, ecommerce web design from £5,000 and SEO from £1,500 a month, with no lock-in contract. You work directly with the founder-led team building your site.
Who This Is NOT For
Businesses launching a new site next week with no URL list. A proper redirect map takes time. Delay the launch rather than guess.
Anyone wanting to redirect everything to the home page. It is quick but it throws away the relevance of each old page.
Sites trying to pass ranking from unrelated expired domains. Redirecting unrelated domains to boost rankings is a spam tactic we do not use.
Frequently Asked Questions
What is the difference between a 301 and a 302 redirect?
A 301 says the move is permanent, and Google treats it as a strong signal that the new URL should be indexed. A 302 says the move is temporary, and Google treats it as a weak signal, so the old URL may stay in results. Use 301 for permanent changes.
Do 301 redirects lose SEO value?
A correct 301 to a relevant page is the standard way to move a page and keep its signals. Problems come from chains, loops, redirects to unrelated pages, and removing redirects too soon. Point each old URL straight to its closest match.
How long should I keep 301 redirects?
Google's John Mueller has recommended keeping redirects for at least one year so Google sees them several times. Keep them longer if the old URLs still get links or visits.
Is a 308 redirect better than a 301?
For Google they are equivalent; both are permanent. A 308 also tells browsers not to change the request method, which matters for some forms and APIs. For ordinary page moves, a 301 is fine and is the most widely supported.
Why is my Shopify redirect not working?
Shopify only redirects from URLs that are broken. If a product, collection or page still exists at the old address, the redirect will not fire. Delete or unpublish the old item, then test again in a private browser window.
Should I redirect out-of-stock products?
Not if they are coming back. Keep the page live with a clear message and alternatives. Redirect only when a product is permanently discontinued, and send it to the closest replacement or collection.
Want a migration that keeps your rankings?
We will build your redirect map, test it before launch and watch Search Console afterwards.

