How can I redirect my X.myshopify.com domain to my custom domain?

Hey guys.

I’ve built a store using Lovable integration with Shopify.

Long story short, I can not connect the domain to Shopify because if I do that, the DNS will be of Shopify and my Lovable website I built will not be visible.

Everything is working on my website, including Shopify checkout, but the main issue is that the checkout URL has “X.myshopify.com domain in it.

I want to have a redirection from this URL to my custom URL, so when a customer is in my checkout page and then clicks the logo, it won’t go to the Shopify website, but he goes to the real URL.

Any ideas guys?

Thanks!

What plan are you on in Shopify?
Does it have “Online store” with themes?

If yes, you can modify your theme code to redirect any page to your main URL.
Looks like you do not need any pages, just checkout which is not controlled by your theme, so,
replacing your layouts/theme.liquid with something like this should do:

<html>
  <head>
    <meta http-equiv="refresh" content="0; url=https://your-main-url.com">
  </head>
</html>

Of course would need some tests as I do not know how exactly integration works.

Thanks tim!
Replacing the whole code with that code you wrote was not good, since it says it’s missing some content_for_header and more parts.

What I did is adding that code below the content_for_header, it it worked perfectly.

Thanks again!