FROM CACHE - en_header

SEO - 301 redirect a subdomain to the main domain (sudirectory) with URL matching

New Member
1 0 0

Hi Shopify community,

We are looking to redirect a subdomain like to as we need to upgrade our version of Langify from V1 to V2.

The URLs path will not change and we are looking to achieve the following:

  1. Redirect using 301 Permanent Redirect our subdomain to the main domain.
  2. Match the URL paths so that will automatically redirect to, will automatically redirect to, will automatically redirect to and so on.

Unfortunately, we can not easily add a RegEx (Regular Expression) as we could have done if we had access to the .htaccess file, like the one below :


<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)$$1 [L,NE,R=301]



Any idea about the best way to achieve such redirect in Shopify?

Thanks a lot,

Replies 2 (2)
Shopify Partner
3012 181 489

Dear @Killian_ 

Either do it manually or use easy redirect Shopify app

Click Here to Hire Shopify Store Customization Experts
Boost Conversions & Average Order Value with this
Best App for Sticky Add To Cart
Shopify Partner
13 0 1

The easy way is use CloudFlare for free  you get 3 page rules these are most of the time plenty to do what you need.


If you do need more I believe they sell them at $5 for 10 pages rules

The time it takes you to change your DNS over to CloudFlare is literally under 15 minutes

remember when you set up the DNS for your DNS  make sure that the orange cloud is on for the subdomains you want to redirect

See the orange proxy toggle





CloudFlare any cast DNS is free and one of the fastest on the planet making it one of the best values in the world.


With the gray cloud on the DNS it acts like any other high-quality DNS however when you turn the orange cloud turns on the  proxy on.


You Will have on the edge regex redirects on the edge  allowing you to create redirects with regex


(DO NOT USE IT ON THE URL SERVINGS CONTENT via Shopify in your case it’s the  www)

Shopify uses CloudFlare already & unless you have CloudFlare Enterprise Do not use CloudFlares orange cloud on your www

but it must be on the Subdomain your redirecting to your subfolder in your example case you can use it on your bare domain only if you have a www. serving the final content.


Page Rule subdomains require an "Orange Clouded" DNS record for the Page Rule to work. Page Rules won't apply to subdomains that don't exist in DNS or aren't being directed to Cloudflare.





Fastly  this  is not as simple but here is some information I have written about this issue.


Go to reply 2 on this

Let me know if you have any questions this whole procedure takes literally 25 minutes and it’s a very good price if you consider the cost and apps

I hope this helps,