We are transitioning our Shopify ecommerce website (on a Cloudflare managed domain) i.e. domain.com to what will be a sub-domain of a completely different domain i.e. shop.example.com (on a Cloudflare managed domain as well). All content/URLs/paths will remain the same from old domain to new domain and new subdomain. I have read the CF documentation and want to create a global redirect rule, however since the stakes are very high, I want to validate to ensure that we do not make a mistake. It also seems that this could be done several ways (Redirect Rules, Origin Rules, Page Rules, etc.)
Some example paths are below:
From: domain.com To: shop.example.com
From: domain.com/products/product-url-is-here To: shop.example.com/products/product-url-is-here
From: domain.com/collections/collection-name To: shop.example.com/collections/collection-name
Would appreciate any input you have. Also open to other suggestions.
You can create the rule for a subdomain instead for test. Once working then use the switch on the redirect page to turn it off, change the hostname to the actual domain, then switch the redirect back on when you are ready.
If the switch needs to be automated, you’ll have to use the Cloudflare API to control things.