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 Shopify Store

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?

What type of topic is this

Troubleshooting