Magento Multi-Store — Multiple Websites, Stores, and Store Views
In this tutorial, you'll learn how to configure Magento multi-store architecture with multiple websites, stores, and store views to manage different brands, product lines, languages, and customer groups from a single installation.
What You'll Learn
- The Magento scope hierarchy: Global > Website > Store > Store View
- How to create multiple websites, stores, and store views
- How to manage products and categories per website
- How to configure domains and base URLs per website
- How multi-store SEO works with hreflang tags and sitemaps
Why It Matters
Running multiple stores from a single Magento installation saves infrastructure costs and simplifies management. Instead of maintaining separate installations for each brand or language, you manage everything from one admin panel while keeping customers, orders, and products segregated by website.
Real-World Use
A fashion group owns three brands: a luxury line, a casual wear line, and an athletic wear line. Each brand has its own domain, product catalog, pricing, and customer base. They need a single admin panel for management but completely separate storefronts. Magento multi-store architecture handles this with each brand as a separate website within one installation.
Learning Path
flowchart LR
A[Extensions Marketplace] --> B[Multi-Store]
B --> C[Deployment]
B --> D[Maintenance & Upgrades]
C --> E[All Topics]
D --> E
style B fill:#3b82f6,color:#fff
Multi-Store Architecture
Magento's scope hierarchy has four levels:
Global (all websites, stores, store views)
└── Website (domain or brand)
└── Store (product line or category)
└── Store View (language or version)
Scope Levels Explained
- Global — settings apply to every website, store, and store view (e.g., tax classes, extension configuration)
- Website — settings apply to one website (e.g., domain, base URL, payment methods)
- Store — settings apply to one store within a website (e.g., root category, product availability)
- Store View — settings apply to one store view (e.g., language translations, currency)
Use Cases
| Scenario | Website | Store | Store View |
|---|---|---|---|
| Multiple brands | Luxury brand website, Casual brand website | Each brand's product line | English, French |
| B2B and B2C | B2B website, B2C website | Products store, services store | English |
| Multiple languages | Single website | Single store | English, German, Spanish |
Creating Websites
Step 1: Create the Website
- Go to Stores > All Stores
- Click Create Website
- Enter:
- Name — e.g., "Luxury Brand"
- Code — e.g., "luxury_brand" (used in URL and code)
- Sort Order — display order in admin
- Save
Step 2: Assign Root Category
Each website needs a root category:
- Go to Stores > All Stores
- Select the website
- Choose Root Category (create a new one if needed)
Step 3: Add Store
- In the same page, click Create Store
- Select the website
- Enter store name (e.g., "Luxury Clothing")
- Assign root category
- Save
Step 4: Add Store View
- Click Create Store View
- Select the store
- Enter:
- Name — e.g., "English"
- Code — e.g., "en"
- Status — Enabled
- Save
Product Management per Website
Price Scope
Set prices per website:
- Go to Stores > Configuration > Catalog > Catalog > Price
- Set Catalog Price Scope to Website
- Save
Now each website can have different prices for the same product.
Attribute Scope
Attribute values can be set per website for attributes like name, description, and meta data:
<!-- In attribute configuration -->
<attribute code="name" scope="website"/>
Product Visibility per Website
When editing a product, the Product in Websites section lets you choose which websites the product appears on.
Inventory per Website
- Go to Stores > Configuration > Catalog > Inventory > Stock Options
- Set Display Out of Stock Products per website
Category Management per Website
Each website has its own root category, so category structures can be completely different:
flowchart LR
subgraph Website A [Luxury Brand]
A1[Root Category] --> A2[Clothing]
A2 --> A3[Dresses]
A2 --> A4[Shoes]
end
subgraph Website B [Casual Brand]
B1[Root Category] --> B2[T-Shirts]
B2 --> B3[Short Sleeve]
B2 --> B4[Long Sleeve]
B1 --> B5[Jeans]
end
Customer Accounts per Website
Share Customer Accounts
Configure whether customers can use the same account across websites:
- Go to Stores > Configuration > Customers > Customer Configuration > Account Sharing Options
- Choose Share Customer Accounts:
- Global — one account works on all websites
- Per Website — separate accounts per website
Orders per Website
Orders are stored per website. Reports, sales data, and order grids are filtered by website.
View Orders by Website
In the admin Sales > Orders grid, you can filter by website. Order numbers can be configured to include the website prefix for easy identification.
Domain Configuration
Each website gets its own domain.
Configure Base URLs
- Go to Stores > Configuration > General > Web > Base URLs
- Select the website scope from the dropdown
- Set:
- Base URL — https://luxury.mystore.com/
- Base Link URL — {{base_url}}
- Secure Base URL — https://luxury.mystore.com/
Nginx Configuration
server {
listen 443 ssl;
server_name luxury.mystore.com casual.mystore.com;
set $MAGE_RUN_TYPE website;
set $MAGE_RUN_CODE $host;
set $MAGE_RUN_CODE luxury_brand;
if ($host = casual.mystore.com) {
set $MAGE_RUN_CODE casual_brand;
}
root /var/www/magento/pub;
index index.php;
include /var/www/magento/nginx.conf;
}
Multi-Store Configuration Management
Config Inheritance
Magento uses a fallback system for configuration:
- If set at Store View level, use that value
- Otherwise, check Store level
- Then check Website level
- Finally, use Default Config
Clear Cache per Scope
After changing multi-store configuration:
bin/magento cache:clean config
Cron per Website
Run Cron Jobs per website for specific maintenance tasks:
bin/magento cron:run --group=index --website=luxury_brand
Multi-Store SEO
Store Code in URL
Include the store code in URLs for language-based SEO:
Stores > Configuration > General > Web > Url Options > Add Store Code to Url — set to Yes.
Hreflang Tags
For multi-language stores, use hreflang tags to tell Google which language version to show:
<link rel="alternate" hreflang="en" href="https://mystore.com/en/" />
<link rel="alternate" hreflang="de" href="https://mystore.com/de/" />
<link rel="alternate" hreflang="fr" href="https://mystore.com/fr/" />
Separate Sitemaps
Generate language-specific sitemaps:
bin/magento sitemap:generate --store=en
bin/magento sitemap:generate --store=de
Common Mistakes
- Forgetting to create a separate root category for each website, causing all websites to share the same category structure and product display
- Setting price scope to Global when websites need different pricing, forcing all brands to sell at the same prices
- Not configuring the Nginx server block with MAGE_RUN_CODE, causing all domains to show the same website content
- Sharing customer accounts globally when websites serve different regions with different privacy regulations
- Clearing only default cache after multi-store configuration changes, leaving old scope-specific cache values active
Practice Questions
- What is the difference between a website and a store view in Magento scope?
- How do you assign different domains to different websites?
- Why would you set price scope to Website instead of Global?
Challenge: Set up a multi-store configuration with two websites (luxury.mystore.com and casual.mystore.com), each with a separate root category and product catalog, different pricing for shared SKUs, and separate customer accounts.
FAQ
Mini Project
Create a complete multi-store setup for a business with two brands: one selling electronics (electronics.mystore.com) and one selling books (books.mystore.com). Each brand needs its own root category, product catalog, pricing, domain, and theme. Share customer accounts between both brands. Configure different payment methods per website: credit card for electronics, PayPal for books.
What's Next
Now that multi-store is configured, learn about Magento Deployment to take your multi-store setup to production. Then continue with Magento Maintenance and Upgrades for ongoing site management.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro