How to Setup multi website and multi-store in magento2

Blog
Spread the love

Magento Provided a functionality that you can setup multi-website and multi-store for a single Magento installation.

Setup for multi-website and multi-store to follow these step –

Step1 – Create Root Categories

Step2 – Create Websites

Step3- Create Stores

Step4- Create Store View

Step5- Change the Website Base URL

Step1 – Create Root Categories

Create root categories this is optional but when you want to each website to have a root category
then you need to create category

for create categories go to –

Catalog

Categories

Add Root Category

Add Sub Category

Category_dir_img

We created

category for local.bluethink.com website.

1.Technology(Root Category)

PHP( sub category)

PYTHON (sub category)

And category for local.bluethinkinc.com website.

1.Blog(Root Category)

PHP (sub category)

magento2 (sub category)

2.Library(Root Category)

English Books (sub category)

French Books (sub category)

Step2 – Create Websites

for creating website go to Stores→Setting→All Stores.

Create first website: – local.bluethink.com

category_web_img_1

second website – local.bluethinkinc.com

category_web_img_1

Name – use name for identify the website name

code – use unique code for website

Step3- Create Stores

for creating store goto – Stores→Settings→All Stores

on the store page click Create Store

create store for local.bluethink.com website.

category_web_img_2

And create store for local.bluethinkinc.com website

category_web_img_2

Step4- Create Store View

for creating store view goto – Stores→Settings→All Stores.

And on the stores pages click Create Store View

create store view for local.bluethink.com website.

category_web_img_3

and create store view for local.bluethinkinc.com

category_web_img_3

now create another store view for local.bluethinkinc.com website

category_web_img_3

Now, here are your stores,website and store view

category_web_img_4

Step5- Change the Website Base URL

You must change the base URL of each site in the Admin

to change the website base URL go to Stores→Settings→Configuration→Web

as mention in the below images according to this change base URL

and repeat the previous step for change base URL(secure)

previous_step_img.png
configuration_img.png

Now create conf file path(etc/apache2/sites-available),and mention your Servername name like as – (local.bluethink.com ) in bluethink.conf file and enable your site using below command

(sudo a2ensite bluethink.conf)

ter_command_img

and (local.bluethinkinc.com) mention in bluethinkinc.conf file and again run below command

(sudo a2ensite bluethinkinc.conf)

Configuration_img-2

now, open host file using below command

(sudo nano /etc/hosts)

and put below your domain name like as –

127.0.0.1 local.bluethink.com

127.0.0.1 local.bluethinkinc.com Editing the pub/index.php file and
add below code before

$bootstrap = Bootstrap::create(BP, $params);

case – pointing your domain

runCode – Refers to the unique code for the website that you specify when creating your Website

Now, clear cache of Magento and browser you should be able to see to the custom domain.

ter_command_img
Magento_and_browser_img

I hope this blog help you for creating multi-website and multi-store .

bluethinkinc_blog

bluethinkinc_blog

2023-03-02

0

Leave a Reply

Your email address will not be published. Required fields are marked *

Find More Blogs

How to Add a Custom Tab to the Customer Order Detail Page in Magento 2

Spread the love Adding a custom tab to the Order Detail

Exception Handling in Java

Spread the love Introduction – Exception:An unwanted

How to add custom less file in Magento2

Spread the love Source files *.css included into layout

Spring Boot Microservices

Spread the love Microservices architecture has become

Implementation of WireMock for better testing

Spread the love WireMock is a flexible and powerful tool

Magento 2: How to selected default option in configurable options?

Spread the love Configurable products in Magento 2 allow

How To Implement Simple JWT Authentication in Django Rest Framework

Spread the love We’ll learn how to use simple JWT

Optimizing Search: Integrating Elasticsearch in Django Applications

Spread the love What is Elasticsearch? Elasticsearch is a

How to create Customer Segments

Spread the love In Magento 2, “customer

Proxy Design Pattern and Requisition List in Magento 2

Spread the love Requisition List in Magento 2 Requisition

bluethinkinc Blogs