CorefinityCorefinityDocs
Open the Control PanelControl Panel
Go live · 2 of 7

Magento stores on separate domains

Show each Magento website or store view on its own domain from one site.

On this page

One Magento 2 installation can show several websites or store views on different domains, sharing its files and database. Use Magento stores on Domains & HTTPS to choose what each address shows.

Before you start

  • Create the websites and store views in Magento, with their default store views switched on.
  • Open the site in Managed Websites, then Site settings, Domains & HTTPS.
  • Keep Magento store codes in lower case, using letters, digits and underscores, up to 32 characters.

Attach several store domains

Read Magento stores to see the websites, nested store views, base URLs and addresses showing each one. A store view switched off in Magento has no action until you switch it on there.

Choose Attach a domain, enter the main domain and add the other domains as aliases. For each alias, choose Show a Magento store, then its website or store view; Main domain shows can choose a different default.

Attach before changing DNS where possible, then test every store before pointing DNS at the site. Add a domain explains attaching and checking the addresses.

Extra preview addresses for stores cannot be added here. Test an attached store domain with a local hosts-file entry or a site smoke test using that domain as its host.

  1. Request / on each store domain in the browser (with a local hosts-file entry before DNS moves), or run a site smoke test with that domain as its host.
  2. Confirm the final URL is on the store's base URL host (the domain itself, or its bare or www form when the base URL uses it) and the title is that store's. Magento redirects a visitor to the store's base URL; a redirect to any other host means its base URL points elsewhere.
  3. Compare the store's Base URL in Magento stores, or its base_url from corestack_site_magento_stores_list, with the domain before changing DNS.

GraphQL picks its store from the Store header, so it cannot prove a domain's store.

Add a store domain later

In Magento stores, choose Show on a domain… beside the website or store view. Choose an existing alias or enter a new domain, check its DNS and confirm the choice.

The hostname's row then says which website or store view it shows. An alias without a store choice redirects visitors to the primary domain.

Change what an address shows

Choose Change… to show another store, show the default store or redirect the alias to the primary domain. Changing the store keeps the domain attached to this site.

The API's mapping update changes only addresses the site already serves: the primary, its www form or a serving alias. Its hosts object is partial; a null choice removes that host's explicit mapping and uses the default.

Base URLs and www

A store's base URLs move automatically only from the site's preview address, primary domain or its www form. A value on another address stays there until you explicitly choose Move this store's base URLs to this address or the Use action beside the suggested domain.

  • Map both the bare and www forms to the same store if both should show it.
  • When several addresses show a store and its base URL is on none of them, the warning names the store, for example “Choose which address Guns uses for its base URLs.” Choose one; Magento's own redirect chooses the visitor's final address.

If Different address appears, check the base URL in Magento or explicitly move it here. If Magento adds store codes to URLs as a temporary workaround, restore its intended setting and test each store domain.

Follow the change

Wait for Store mapping saved and Store addresses updated before treating the change as finished. A failed step gives its reason; retrying completes the remaining work and keeps a mapping already saved.

Set up by Corefinity support means the extra store addresses are read-only here. Ask support to change those addresses.

Automate this

Magento stores on separate domains

Changes which store an existing served address shows, without adding or removing domains.

PUT/api/corestack/sites/{site}/magento/store-mapping
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/magento/store-mapping \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "domains_version": 0,
    "nginx_version": 0
  }'

Read the stores first for both nginx_version and domains_version. Send both when updating a mapping; a stale answer means you must read them again.

A refused store choice names its field: aliases.<n>.store on a domains save, and hosts.<host> or default on a mapping update. On an attach or attach check, the REST API names stores.<host> or default_store; the MCP tools name aliases.<n>.store or default_store.

Was this helpful?
Open in ClaudeOpen in ChatGPT