For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

  1. Open Locks and create a new lock, or open an existing one to edit it.

  2. Choose the content you want to protect. See Access rules overview for how rules fit into a lock.

  3. Click the Unlock rules tab, then in the Condition type dropdown, select Shop domain.

The Unlock rules tab with Shop domain selected in the Condition type dropdown.
Select Shop domain from the Condition type dropdown on the Unlock rules tab.
  1. Enter the exact domain(s) you want to match — for example, your custom domain or your *.myshopify.com domain. You can add more than one.

The Shop domain rule settings, showing a list input for entering exact domains.
Add each exact domain this rule should match against the visitor's current browsing domain.
  1. Choose If or Unless.

  2. 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.

  1. Select the Staging preview page as the content to protect.

The Lock setup tab with Specific Page as the content type and the Staging preview page listed under Restricted pages.
Pick the page that should stay on the Shopify domain.
  1. Add Shop domain, choose If, and type your-store.myshopify.com into Shop domains. The field already supplies the https:// prefix, so enter the host only — then click Add domain to commit it to the list.

The Shop domain condition with Rule logic set to If, the host typed into the Shop domains field, and the full https:// URL added to the list below.
The condition heading reads: If the visitor shop domain matches your-store.myshopify.com.
  1. Leave the rule's Redirect URL empty.

  2. Set the Access denied message to:

This preview page is only available on the store's Shopify domain.

The Messages card with the Access denied message set to the Shopify-domain-only wording, and the Preview panel rendering it.
The Preview panel confirms the wording before you save.
  1. 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.

The Staging preview page displaying the configured Shopify-domain-only message.
On the public custom domain, the visitor sees the Access denied message from this example.

Last updated

Was this helpful?