A Step By Step Guide To Set Up Magento 2 Multistore

ZealousWeb
4 min readSep 7, 2020
A Step By Step Guide To Set Up Magento 2 Multistore

Magento 2 is one of the popular platforms used for developing enormous types of websites. It also enables developing e-commerce websites. With ample features to include, Magento is the easy to use platform for every developer. Besides, it does not require any special skills or knowledge to learn to set up a multi-store. A step by step guide can help anyone to easily and quickly set up the Magento multistore as desired.

Rather than managing multiple admins for a different store, you can easily manage all the stores in a single admin panel.

Benefits Of Magento Multi-Store Setup

  • This is an incredibly powerful platform for e-commerce website development
  • The multi-store function makes it to be the right choice
  • It allows adding many new stores in an effective and easy way
  • It enables hosting many stores with different domains, however, sharing the same backend
  • It allows taking same domain with various directories
  • Allows using subdomains for unlimited Magento powered shops
  • Enables easily managing many stores
  • It enables effective search engine optimization

Key Features Of Magento Multi-Store Setup

  • Magento cart architecture is best used for multi-store site deployment
  • Allows multiple websites or stores to be installed in one installation
  • Effective site management
  • Advanced marketing promotions and tools
  • Effective search engine optimization
  • Allows you to manage store-specific inventory
  • Allows you to manage all the stores from single admin panel

The multi-store functionality of Magento will allow the clients to easily manage numbers of online stores in just a single installation. This will reduce the overall efforts of many single websites. Magento offers many added features such as Add to Cart, Full Page Cache, Pricing options and many more, which save your money and time. This enables you to set up the entire site within the expected budget range.

Magento 2 comes with the Varnish and Elastic search and all the stores are on the same server so you can configure varnish and other services one time and use it for all the stores.

What Are The Different Types Of Urls With The Magento Multistore?

We can have two types of URLs while setting up the multiple stores or website.

Sub-Domain

A single installation can help to host more than two sores by sharing the same Magento backend, such as store1.xxxx.com, store2xxxxx.con and more

Here you can create the subdomain and point to the Magento installation directory.

Folder

This type of installation will allow installing three various stores on the same domain name, but with different directories such as:

Sitename.com/store1, sitename.com/store2 and more

Different URL’s, include site1.com, site2.com, site3.com and more

A Step By Step Guide For Magento Multi-Store Setup

It is common with e-commerce businesses to require more than one website in multiple languages over the days as the business grows. This thus emphasizes the need to set up your website with Magento multistore, which will benefit the businesses in great ways.

As said, Magento features numbers of powerful tools and techniques. The multi-store feature of Magento is considered to be the effective one with significant values in it. Besides knowing all great things of Magento multi-store setup

Let’s see how to configure multiple stores or websites in Magento 2.

Step: 1

  • The foremost thing to do in this step is to create “Categories”. The default root category will be used, as the same catalogue will be shared by other sites
  • Got to Catalog > Categories > Manage Categories
  • Create a new category and set it to active.

Step: 2

  • Once you create the category, you need to create a new website.
  • Go to the Store > All stores > Click “Create Website”
  • After creating the website, create a new store and select the root category for this store.
  • After creating the website and store, you need to create a store view. Add all information and create a store view.
  • Go to store > Configuration > General > Web
  • Change the website from the top of the page.
  • Now you need to enter the base URL and secure base URL of the website.
  • You need to perform the same steps for all the website you created
  • Save the configuration of all the websites.

Step: 3

  • On configuring all domains, now ensure that the desired domain name points web server
  • If you have created separate folders for all the websites then you need to copy the root folder index.php and .htaccess file to the respective folders.
  • In each index file, you need to change the path for the bootstrap file and need to run a specific website code. Check below code to run specific websites.

$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = ‘website_code’;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = ‘website’;
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);

  • If you pointed all the domains in the same directory, you need to add below code to the .htaccess file.

SetEnvIf Host .*newstore.* MAGE_RUN_CODE=website_code or store_code
SetEnvIf Host .*newstore.* MAGE_RUN_TYPE=website or store

Conclusion

Multi Websites in Magento allows you to manage different websites within the single Magento admin. You can manage products, categories, customers etc website wise from the Magento admin panel. It is also easy from the development side as if there are any updates in Magento or Extensions, you just need to update it once for one Magento and will work for every website setup in Magento.

Originally published at https://www.zealousweb.com.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

ZealousWeb
ZealousWeb

Written by ZealousWeb

Helping businesses Solve The Unsolved with a tech-first approach to expedite digital transformation.

No responses yet

Write a response