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

Proxy Design Pattern and Requisition List in Magento 2

Spread the love Requisition List in Magento 2 Requisition

Google Ads Conversion Tracking Through Magento Platform:

Spread the love Google Ads Conversion Tracking Through

Object Pool Pattern in Magento2

Spread the love What is Object Pool Pattern in Magento 2 An

JENKINS

Spread the love JENKINS Introduction and Installation

Virtual Type and Type

Spread the love Virtual type is one of the most common

Customize the length of Input field

Spread the love Sometimes we need to change the limit the

How to Add Custom Tab on Admin Dashboard and Count Website Total Visitor in Magento 2?

Spread the love In this blog we’ll see How to Add Custom

How to Add Sign Out Tab in Customer Account in Magento 2?

Spread the love In this blog we’ll see How to Add

How to create custom tab in product detail page in magento 2?

Spread the love In this blog we’ll see how to add

Understanding and Implementing CORS & CSRF

Spread the love What is security? The world has become more

bluethinkinc Blogs