Shop domain
Match visitors based on the exact domain they're currently browsing your store on.
Shop domain matches the exact hostname a visitor is using to browse your store. This is useful when your store is available through both a connected custom domain, such as www.your-store.com, and its original Shopify domain, such as your-store.myshopify.com.
Use this rule to make protected content available only on your public custom domain, or to keep a testing flow available only through the myshopify.com domain.
Enter one or more domains without a protocol or path, for example www.your-store.com or your-store.myshopify.com.
If: the visitor matches when their current domain is one of the domains you entered.
Unless: the visitor matches when their current domain is not one of the domains you entered.
When this rule is combined with other Lock conditions, every condition must be satisfied. See Combining rules.
Add the rule
Open Locks and create a new lock, or open an existing one to edit it.
Choose the content you want to protect. See Access rules overview for how rules fit into a lock.
Click the Unlock rules tab, then in the Condition type dropdown, select Shop domain.

Enter the exact domain(s) you want to match — for example, your custom domain or your
*.myshopify.comdomain. You can add more than one.

Choose If or Unless.
Click Save.
Example: Keep a preview page on the Shopify domain
Suppose your public store uses www.your-store.com, but a preview page should only be available through your-store.myshopify.com.
Select the Staging preview page as the content to protect.

Add Shop domain, choose If, and type
your-store.myshopify.cominto Shop domains. The field already supplies thehttps://prefix, so enter the host only — then click Add domain to commit it to the list.

Leave the rule's Redirect URL empty.
Set the Access denied message to:
This preview page is only available on the store's Shopify domain.

Click Save.
Result on the storefront
The page opens normally at your-store.myshopify.com. When the same page is opened at www.your-store.com, the domain does not match, so the page remains locked and displays the message above.

Related docs
Last updated
Was this helpful?