How to Properly 301 Redirect /collections/*/products/* to /products/* in Shopify?

Short description of issue

Shopify allows product access via both /products/handle and /collections/collection-handle/products/handle. While canonical tags help SEO, indexed collection-scoped URLs require true 301 redirects—but Shopify’s native redirect system ignores these dynamic paths, and Liquid/JS cannot issue real 301s.

link to store: Labubu Original Deutschland – Blind Box Figuren für Sammler

Reproduction steps

  1. Create a product and assign it to a collection

  2. Visit: domain/collections/collection-name/products/product-handle → page loads with 200 OK

  3. In Shopify Admin → Online Store → Navigation → URL Redirects, add:
    a. Redirect from: /collections/collection-name/products/product-handle
    b. Redirect to: /products/product-handle
    c. Type: 301

  4. Save and reload the old URL → no redirect occurs (still 200 OK)

  5. Try JS/Liquid redirect → works for users but still returns 200, not 301

Additional info

Theme: Confirmed canonical tag is present:
Goal: Prevent duplicate content & preserve SEO equity from backlinks to collection URLs
Workarounds tried:
JS redirect in theme.liquid → user-friendly but not SEO-safe
robots.txt block (Disallow: /collections//products/) → helps long-term but doesn’t redirect
Shopify limitation: Dynamic routes like /collections/
/products/* are not real pages, so native redirects don’t apply
Question: Is there any server-side or edge-based method (without heavy apps) to force real 301s?

No, if you use general theme-based service.

Shopify redirects do not work if original URL can be rendered/shown.

The only way to (maybe) avoid these collection-aware links from being crawled is to not generate them. So basically, have only canonical product URLs output on collection pages – some themes have a setting in the theme for this.

You can go headless or maybe implement some kind of logic with Cloudflare services.

Shopify doesn’t support or allow you to create nested url structure, and redirects are limited to pages that don’t exist. Sounds like you need to go through your theme code and get rid of unsupported site structure.

Shopify’s online sales channel does NOT have this feature.
Merchants that want control over a shopify-stores URL structure need to go headless with storefront SDK, or hydrogen, etc and be their own host.
READ: $$$$

Merchants that want to set CANONICAL urls should see all existing pots on the subject found through search.
https://community.shopify.com/search?q=canonical+url

@deenajacob These are some of the many time & money wasting habits new merchants make don’t make a habit of it:
Don’t bury the lead in communications, open with the question UPFRONT.
This isn’t a bar no need to be coy. ib4: no, don’t just rely on the title for the ask

Avoid self-prescribing a solution with an inexperienced diagnosis , e.g. https://xyproblem.info/
What is the actual goal, redirects aren’t a goal they are an implementation you self prescribed ignoring your own listed goal:
“Prevent duplicate content & preserve SEO equity from backlinks to collection URLs”
which is just canonical urls, don’t overcomplicate things before talking to an expert first.

firstly, can you please confirm if you removed or deactivated these types of URLs using any method:

/collections/collection handle/products/product handle

that’s because you can only redirect pages that return a 404 page with shopify’s native functionality of setting up 301 redirects. if your aim is to go beyond that functionality, you might have to use Shopify redirect apps that allow you to redirect active (webpages that return 200 OK) pages.

and I am personally not aware of any server-side tweaks that you can make. at the most, i feel you will have to use an app to solve your issue.

Thanks for the replies!

@PaulNewton — to make sure I’m not falling into the XY trap again:

My goal: Prevent duplicate content from URLs like /collections/x/products/y.

I know Shopify sets the canonical correctly (/products/y), and I’ve removed | within: collection so new links won’t be created.

My question: Is there any way to 301-redirect or block those old collection-scoped URLs without going headless?

From what I’ve learned:

  • Native redirects only work on 404s (these return 200),

  • True server-side 301s aren’t possible on Online Store,

  • So best practice is to rely on canonicals + clean sitemaps and let search engines deduplicate over time.

If that’s correct, I’ll stick with it — just want to confirm I’m not missing a hidden option!

Hi @Amlani ,

Thanks for your reply!

Yes, I haven’t removed or deactivated those URLs—they still exist and return a 200 OK status (since Shopify treats /collections/x/products/y as a valid product page).

What I have done is stop generating new links to them by removing | within: collection from all product card links. So going forward, internal navigation only uses the canonical /products/y URLs.

I understand Shopify’s native redirects only work for 404s, and I’ve also read that most redirect apps use client-side (JavaScript/meta refresh) redirects for active pages—which don’t pass SEO equity like true 301s.

Given that Shopify already sets the correct canonical tag on all product pages (always pointing to /products/y, even when accessed via a collection), my current plan is to rely on canonicalization + clean internal linking and let search engines handle the rest over time—unless there’s a server-side method I’m missing.

Does that sound reasonable to you?

Thanks for the input!

Just to clarify: the /collections/x/products/y URLs aren’t something I added via theme code — they’re Shopify’s default behavior when a product is viewed from within a collection. The platform fully supports (and generates) these URLs natively.

My goal isn’t to “fix” an unsupported structure, but to avoid duplicate content, since both /products/y and /collections/x/products/y return the same product (with the same canonical tag pointing to /products/y).

I’ve already updated the theme to stop linking to the collection-scoped URLs (by removing | within: collection), so new links won’t be created. Now I’m just confirming whether further action (like redirects) is needed — or if relying on Shopify’s canonical tags is sufficient.

Appreciate the help!

Thanks, @tim_tairli — that’s a really clear summary.

Just to confirm: I’ve already updated the theme to stop generating collection-scoped product URLs on collection pages (removed | within: collection from all product card links), so going forward, only the canonical /products/y URLs are being linked internally.

My remaining question is about the already-existing /collections/x/products/y URLs:

  • They’re still accessible (return 200),

  • They were likely crawled/indexed in the past,

  • But Shopify correctly sets the canonical tag to /products/y.

Given that, is it safe to rely solely on canonicalization (plus clean sitemaps), or would you still recommend exploring Cloudflare/edge logic or headless for true 301s?

My instinct is that for most stores, canonicals are sufficient — but I’d love your take!

Hi @Maximus3 ,

Thanks for your message.

The URL structure /collections/x/products/y isn’t something I created manually or imported. It’s actually Shopify’s built-in behavior:

  • When you visit a product from within a collection page, Shopify automatically serves the product at /collections/{collection-handle}/products/{product-handle}.

  • This is not a nested collection (like /collections/mens/shoes), but a collection-scoped product URL — and it’s fully supported by Shopify.

:link: Example:
On any Shopify store (even demo stores), go to a collection → click a product → the URL will be:
https://yourstore.com/collections/hoodies/products/winter-pullover
…even though the canonical tag on that page points to:
https://yourstore.com/products/winter-pullover

You can’t disable this routing in the Shopify Admin — it’s part of how the platform works.

As you rightly said: as long as the canonical tag is correct (which Shopify handles automatically), duplicate content isn’t an SEO issue. I’ve just been double-checking whether redirects are needed — but consensus (and Shopify docs) say they’re not.

Hope that clears it up! Happy to share a live example if helpful.

Glad we cleared that up. We’re talking about the same thing: content-aware url. Completely normal behavior. Maybe a little strange if you’re not used to it. So you don’t need to do anything. Should be all good… No need for seo worries.

I tend to think that canonicals should be ok doing their job.
The only problem with huge amount of URLs is crawl budget.

People freak out when they go to Google search console and see, say 200 000 “Alternate page with proper canonical tag” and try to “Fix” it, but in fact there is nothing to fix.
It means Google already learned that those URLs lead to the pages which are already indexed. Would Google continue re-crawling those? That’s the question.

Yes, preventing this would probably be the right thing to do, but if they are already crawled there is not much we can do.

You may try blocking those with robots.txt or “noindex” meta, but as far as I know, those are not strong enough.

Unfortunately, we can’t do proper 404/301 at will and headless/Cloudflare solutions would cost serious money which IMO can be spent elsewhere with better ROI.

Also – I’d rather amend the “Related Products” URLs as well as they are known to generate tons of URLs.


(However, I am not a SEO strategist, rather a theme dev).

@tim_tairli
Totally agree — and thanks for highlighting the crawl budget angle. That’s the only real concern here, not duplicate content (since canonicals are solid).

I’ve also seen those “Alternate page with proper canonical tag” reports in GSC and initially panicked too :sweat_smile: — but you’re right: it just means Google understands the relationship and has already indexed the canonical.

Good point about Related Products — we’ve already updated those sections to use only canonical product URLs (no | within: collection anywhere), so we’re not adding to the issue going forward.

And yes, blocking via robots.txt or noindex isn’t ideal:

  • robots.txt blocks crawling but not indexing,

  • noindex on collection-scoped pages could conflict with canonical signals.

So for now, we’re sticking with:
:white_check_mark: Clean internal links (canonical-only),
:white_check_mark: Trusting Shopify’s canonical tags,
:white_check_mark: Letting Google naturally deprioritize the collection-scoped versions over time.

And absolutely — headless or Cloudflare redirects aren’t worth the ROI for this. Better to focus energy on content, speed, or conversion.

Appreciate the thoughtful take!

Related/Complimentary products generate links like this:
https://labubuoriginal.de/products/have-a-seat-vinyl-plush-mystery-box-1-single-blind-box-labubu-the-monsters?pr_prod_strat=jac&pr_rec_id=14d48b3c3&pr_rec_pid=15056809886022&pr_ref_pid=15056812704070&pr_seq=uniform

These URL params are used to fine-tune your recommendations, so stripping them may affect recommendations precision, but obviously there is a huge potential to exhaust your crawl budget.
I’ve written about this here – Removing URL parameters - Recommended Products Section

And here, but forum migration has eaten the code I’ve shared – Removing URL parameters - Recommended Products Section

The idea was to move URL params to the data attribute on the link so that href points to the canonical URL, but when clicked, JS code will pull these parameters from the data attribute and redirect visitors to full URL.
This way crawler sees only canonicals but recommended products fine-tuning works too.