Summary
On a store whose markets use subfolders on a custom primary domain, shopify theme dev can’t render those market URLs. Default-language subfolders return 404. Other languages return 200, but merchant content stays in the default language. The same theme renders all of these URLs correctly when previewed on the primary domain.
Environment
- Shopify CLI: 5.0.1 (latest at time of writing)
- OS: macOS 27.2 (arm64)
- Node: 24.15.0
- Shell: zsh
Store setup
- Custom primary domain (
example.combelow).your-store.myshopify.comredirects to it. - Live URLs are all subfolders:
/en-us,/es-us,/en-ca,/fr-ca. The root/redirects to/en-us. - Markets: US and Canada.
- Languages:
en(default),fr,es.
Steps to reproduce
- Run
shopify theme dev -s your-store -t your-theme. - Open
/en-us,/en-ca,/es-us, and/fr-caonhttp://127.0.0.1:9292. - Open the same paths on the primary domain with the same theme, e.g.
https://example.com/fr-ca?preview_theme_id=<dev theme id>.
Expected behavior
Market URLs render locally the same way they do on the primary domain, with the right language, market, and root path.
Actual behavior
| Path | theme dev |
Primary domain, same theme previewed |
|---|---|---|
/en-us |
404 | 200, Shopify.routes.root is /en-us/ |
/en-ca |
404 | 200, Shopify.routes.root is /en-ca/ |
/es-us |
200, Shopify.locale is es-US, Shopify.routes.root is /es/, merchant content in English |
200, Shopify.locale is es, Shopify.routes.root is /es-us/, translated |
/fr-ca |
200, Shopify.locale is fr-CA, Shopify.routes.root is /fr/, merchant content in English |
200, Shopify.locale is fr, Shopify.routes.root is /fr-ca/, translated |
Other behavior on the local server:
- Any
fr-XXores-XXprefix returns 200, including/fr-beand/es-mx, and the suffix is copied intoShopify.locale. Anyen-XXprefix returns 404. - Theme strings on these pages do come from
fr.jsonandes.json, so the page is partly translated. Content translated in Shopify is not. - Links on
/fr-capoint to/fr/..., so navigating leaves the market URL./fritself is a 404 on the primary domain. /?country=CAredirects to/en-ca, which then returns a 404.
Reproduction without the CLI
These requests reproduce the same behavior against the published theme, with no dev server running:
curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' 'https://your-store.myshopify.com/fr-ca'
# 301 https://example.com/fr-ca
curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' 'https://your-store.myshopify.com/fr-ca?pb=0'
# 301 https://example.com/fr-ca?pb=0
curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' 'https://your-store.myshopify.com/fr-ca?_fd=0'
# 200
curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' 'https://your-store.myshopify.com/en-ca?_fd=0&pb=0'
# 404