2 Domains - 2 Languages

Hello

I have 2 domains set up for my site . One .se ( swedish) and one .dk (danish)

I would like when a customer searches for the Danish website, he is redirected to the Danish language automatically and same for the Swedish.

It is the same website which a language selector at the top - but 2 domains -

Main domain being the Swedish

Thanks

Hi @TBS2023

I totally get what you’re trying to do. You have two domains—one for Sweden (.se) and one for Denmark (.dk)—but since it’s the same website with a language selector, you want visitors to automatically see the correct language based on the domain they enter. That makes sense for user experience!

Solution: Auto-Redirect Based on Domain

Since Shopify doesn’t have built-in settings for this, you’ll need to use custom code in Liquid or redirect rules in your theme’s JavaScript. Here’s the best way to do it:

1. Use Liquid Code to Detect the Domain

You can modify your theme.liquid file to check the domain and automatically change the language. Add this code inside the tag:

Make sure to replace yourdomain.dk and yourdomain.se with your actual domains.

2. If You’re Using Shopify Markets (Recommended)

If your Shopify plan includes Markets, you can set Market-specific domains to serve different languages automatically:

  1. Go to Settings > Markets in your Shopify Admin.
  2. Click on Manage next to Denmark and Sweden.
  3. Under Domains & Languages, assign the correct domain (.dk for Danish, .se for Swedish).
  4. Make sure the correct language is selected for each domain.

This method is better because it’s officially supported by Shopify, and users won’t experience a manual redirect.

Final Thoughts

If you want the smoothest experience, I highly recommend using Shopify Markets to handle the language switch automatically. But if that’s not an option, the JavaScript method will work fine.

Let me know if you need extra help. Just let me know asap. Thanks!
Daisy.