Happening now | Office Hours: Customizing Your Theme With Shopify Partner @tim | Ask your questions now!

Re: Relative Redirect: Language change to another relative URL

Relative Redirect: Language change to another relative URL

Sayle
Visitor
1 0 0

Is it possible to redirect relatively? Example: 'shop.com/A/x.html' to 'shop.com/B/x.html'

 

I want to redirect customers to a special site with different 'Custom-Liquid-Sections' because the 'Translate&Adapt'-App does not translate these sections. So i made another store front with manually edited 'Custom-Liquid-Sections'. I need to redirect from default language selection ./en/. to my special (sub)site ./en-en/. is there anyway to do this nicely without htaccess (301)?

Thanks for your help in advance!

Reply 1 (1)

22Ben
Visitor
1 0 0

Add the following in the 'theme.liquid' file, in the code editor:

 

<script>

if (window.location.href === "shop.com/A/x.html") { window.location.href = "shop.com/B/x.html"; }

</script>