"Cloudflare Workers: Path-based routing (/blog) not working with Shopify store"

What is the name of the domain?

What is the error number?

404 (HTTP Status Code)

What is the error message?

HTTP/2 404 date: Wed, 11 Jun 2025 10:10:40 GMT content-type: text/html; charset=utf-8 x-sorting-hat-podid: 340 x-sorting-hat-shopid: 76394725717 x-storefront-renderer-rendered: 1 powered-by: Shopify server: cloudflare cf-ray: 94e051eb5f04224e-AMS

What is the issue you’re encountering

When trying to access /blog routes on our Shopify store (trendy.nl/blog), the requests are being intercepted by Shopify and returning a 404 error, instead of being handled by our Cloudflare Worker which should forward these requests to our Vercel-hosted Next.js blog.

What steps have you taken to resolve the issue?

Created a Cloudflare Worker to intercept /blog routes
2. Configured worker routes in wrangler.jsonc for trendy.nl/blog*
3. Changed DNS A-record to Cloudflare IP
4. Set AAAA-record to “Proxied”
5. Attempted to use Cloudflare Transform Rules
6. Verified through headers that Shopify is still handling requests

What feature, service or problem is this related to?

I don’t know

What are the steps to reproduce the issue?

Set up a Shopify store on a domain (trendy.nl)
2. Create a Cloudflare Worker with routes for /blog*
3. Deploy a Next.js blog on Vercel
4. Try to access domain.com/blog
5. Observe that Shopify returns 404 instead of the request being handled by the Cloudflare Worker

Make sure you are using the shops.myshopify.com CNAME for Shopify (including for the apex domain if you are using that on Shopify), not A/AAAA records, and they are proxied, see…

1 Like

Is it even possible what I want to do Shopify?

I want to use one domain.
trendy.nl for webshop (shopify
trendy.nl/blog for blog (vercel next.js)

You would need to ensure O2O is working, then you can use a Worker (or Snippet on paid plans) to proxy the requests for /blog to Vercel based on this example…

Or use blog.trendy.nl to point at Vercel.