One of the most common objections to consolidating content into subfolders is that the platform forces a subdomain — Shopify and Zendesk both default to their own subdomain-style URLs. A reverse proxy solves this without migrating platforms: intercept requests at the edge (Cloudflare Workers or NGINX) and route a subfolder path to the third-party origin, while the URL a user or crawler sees stays on your root domain.
User / Googlebot → request: example.com/shop/item-1
[Cloudflare Worker at the edge]
┌──────────────┴──────────────┐
path: /blog/* path: /shop/*
forward to WordPress origin forward to Shopify originThe worker script
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const url = new URL(request.url)
if (url.pathname.startsWith('/shop')) {
const targetOrigin = 'https://your-store.myshopify.com'
const newUrl = new URL(targetOrigin + url.pathname + url.search)
const modifiedHeaders = new Headers(request.headers)
modifiedHeaders.set('X-Forwarded-Host', url.hostname)
modifiedHeaders.set('Host', 'your-store.myshopify.com')
const modifiedRequest = new Request(newUrl, {
method: request.method,
headers: modifiedHeaders,
body: request.body,
redirect: 'manual'
})
return fetch(modifiedRequest)
}
return fetch(request) // default: pass through to the main site origin
}What to check before calling it done
Bind the worker to the relevant route in Cloudflare (example.com/shop* → worker), then verify three things before treating the migration as complete:
- Host header rewriting — confirm the third-party platform accepts the proxied request without returning a 403 or redirect loop
- Canonical tags — pages served at example.com/shop/item-1 need self-referential canonicals, not ones pointing back at the myshopify.com origin
- Asset routing — relative CSS/JS/image paths on the third-party platform often need their base URL updated to match the proxied subfolder path, or they'll 404
Related articles
GA4 Cross-Host Tracking Without Data Fragmentation
A single user journey across a subdomain or third-party checkout can silently split into separate sessions if domain measurement isn't configured.
Subdomains vs Subfolders for SEO — Which Should You Use?
Google says it treats subdomains and subfolders the same. Crawl data from real migrations says otherwise. Here's a practical decision matrix for which to use.
The Subdomain-to-Subfolder Migration Blueprint
The structure change is the easy part. The redirects, canonicals, and GSC property setup are where migrations actually go wrong.
International SEO Architecture: Subfolders vs. Subdomains vs. ccTLDs
International expansion is one of the few legitimate reasons to reach for a subdomain or ccTLD instead of a subfolder. Here's how to actually choose.

Written by
Paul Lovell
International SEO Consultant & Founder of Always Evolving SEO. 15+ years running technical audits, log-file analysis, and root-cause fixes for multimillion-dollar businesses — speaker at SMX London, Search & Content Summit, and SEMrush events.