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

Killian_
New Member
1 0 0

Hi Shopify community,

We are looking to redirect a subdomain like https://es.website.com/ to https://www.website.com/es/ 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 https://es.website.com/collections/collection-1 will automatically redirect to https://www.website.com/en/collections/collection-1, https://es.website.com/collections/collection-2 will automatically redirect to https://www.website.com/en/collections/collection-2, https://es.website.com/product/product-1 will automatically redirect to https://www.website.com/es/product/product-1 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 ^(.*)$ https://www.website.com/es/$1 [L,NE,R=301]

</IfModule>

 

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

Thanks a lot,

0 Likes

Dear @Killian_ 

Either do it manually or use easy redirect Shopify app

Best Regards
MS Web Designer| MS Web International | Task4Store
Contact Us: https://www.task4store.com/pages/contact-us OR task4store@mswebdesigner.com
Was our reply helpful? Please Like or Accept solution
0 Likes