Stop Redirect subdomain to Primary domain

Topic summary

Subdomain shop.example.com was redirecting to the primary domain example.com in a Shopify store; the goal was to keep the subdomain accessible without redirecting.

One reply suggested checking SSL/HTTPS setup and server config: install a valid SSL certificate, and in cPanel ensure the subdomain’s directory name exactly matches the subdomain; if not, create a symlink. This addressed cases where HTTP worked but HTTPS redirected to the main domain. (SSL = security certificate enabling HTTPS.)

The original poster resolved it within Shopify by using Markets: create an International Market, click Manage, then under Domains and languages assign the desired domain or subdomain to that market. To speed propagation, set a very low DNS TTL (e.g., 1 minute) for the subdomain so changes take effect quickly. (TTL = how long DNS records are cached.)

A later participant reported the same issue and asked for clearer step-by-step help, indicating the solution exists but needs elaboration for others. Status: partially resolved; follow-up clarification requested, discussion ongoing.

Summarized with AI on January 4. AI used: gpt-5.

Hi I added a subdomain and when I go to the subdomain link: shop.example.com it always redirects it to the Primary domain example.com.

You can tell that I should go to the subdomain and set it as Primary domain, but I want that my primary domain to stay as the primary domain and when I go to the subdomain it stays as shop.example.com and not redirects to the Primary domain.

Thanks

1 Like

Hello @emyabdel77

All you need is a valid SSL certificate installed on your host and then, if you want, add a redirect so that your pages and posts are delivered via HTTPs (as opposed to HTTP). Of course you could always use CloudFlare with their Flexible SSL however in this post we’re concerned with you having a SSL certificate on your host.
Unfortunately all doesn’t always go quite so well; an issue that comes up often is where a subdomain always redirects to the primary domain when trying to view the subdomain with HTTPs. For example, when you go to http://subdomain.example.com then you view your pages as on your subdomain. When you go to https://subdomain.example.com however you see a page on your example.com website (most commonly the 404 not found error page).

From my experience, the most common cause for this problem with cPanel is that the subdomain directory name on the server is not identical to the subdomain name. For example, the directory name may be my-subdomain whereas your actual subdomain is mysubdomain (e.g. mysubdomain.example.com). For whatever reason the directory name must exactly match the subdomain name.

Fortunately the fix for this issue is simple. All we need do is create a symlink so that a link is created with the same name as the subdomain which then points to the directory into which your subdomain files are saved. If this doesn’t make much sense to you then contact your hosts technical support and ask them to create the symlink.

I hope the above is useful to you.
Best regards,
GemPages Support Team

GemPages thanks for your answer. the problem is solved by creating an international market, then click manage button for this market and on Domains and languages choose Domain or subdomain

and put your subdomain there. If you want that changes to take effect immediately go to your DNS manager and for the subdomain make ttl=1 so you will wait just one minute and changes take effect so subdomain will not redirect

Hi @emyabdel77 ,

I go through the same problem. We will need to have separete subdomain and it shouldn’t redirect to the primary domain. However, I don’t understand how you figured out exactly. Could you please help me?