Subdomain Homepage Redirects

Topic summary

Goal: Map each subdomain’s root (/) to a different internal Shopify page for unique “homepage” experiences (e.g., testkitchen → /pages/test-kitchen; savannah → /pages/savannah-homepage) without extra clicks.

Key points:

  • Shopify limitation: No native way to assign distinct homepages per subdomain.
  • External redirect option: If DNS is hosted outside Shopify, set a 302 (temporary) redirect at the DNS/hosting layer; alternatively, point the subdomain to external web space and use a PHP redirect (a code snippet was provided).
  • Theme/front-end option: Use theme logic to detect the hostname (e.g., window.location.hostname) and either render a custom template per subdomain or perform a client-side redirect to the intended page.

Clarifications:

  • 302 redirect = temporary HTTP redirect from server/hosting to a target URL.
  • Theme logic = conditional Liquid/JavaScript in theme files to tailor rendering or redirect based on the subdomain.

Status/next steps:

  • The original poster requested specifics on where to place the script and how it works; guidance on implementation details (file locations, code examples) is still pending. Discussion remains open.
  • Markets/Shopify URL routing rules were not offered as solutions.
Summarized with AI on December 10. AI used: gpt-5.

Hi everyone!
I’m setting up multiple subdomains on my Shopify store, and I’m trying to have each subdomain’s root URL (/) display a different internal page.

What I want to achieve:

  • testkitchen.messhalltruckshop.com → should load /pages/test-kitchen

  • savannah.messhalltruckshop.com → should load /pages/savannah-homepage

Essentially, when someone visits either subdomain, I want them to land on a unique “homepage” experience without needing an extra click or redirect link.

My question:
What is the best way in Shopify to route each subdomain’s root path to a specific page?
Is there a method using Markets, URL routing rules, Liquid logic, DNS, or a recommended workaround that allows each subdomain to have its own homepage?

Any guidance, examples, or best practices would be greatly appreciated! Thanks so much.

If you host your DNS somewhere other than Shopify: Simply insert a redirect (302).

Alternatively, point to the web space and insert the redirect via a php script.

<?php
header('Location: https://your-location.com/page');
exit;
?>

Hi @messhalltruckshop

Shopify doesn’t have the native ability to set a unique homepage per subdomain but you can use theme logic to check the hostname and load the appropriate page template.Create for each subdomain your own template and redirect your visitors with a small script that checks the window location, hostname, and let each subdomain have its own custom landing experience.

what and where would i put the script and how would this work?