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

Custom API to Fetch Customer Data by Customer ID in Spryker

Spread the love Introduction In this blog post, we will

Creating a Custom Module for a Custom Frontend Page in Spryker

Spread the love To create a custom module for a custom

How to create custom module api get category list without access token in Spryker

Spread the love To create a custom API for fetching a

Creating a Custom Glue API in Spryker

Spread the love Spryker’s Glue API is a powerful tool

Get AI Generated 360-Degree View of Account Summary in Dynamics 365 Sales

Spread the love Navigating the demanding landscape of sales

Enhancing Productivity with Dynamics 365: The Power of Session Restore

Spread the love Enhancing Productivity with Dynamics 365:

Salesforce Admin

Spread the love In our last blog, we discussed common

Unlocking AI with Spring Boot: Real-World Use Cases and Solutions

Spread the love Artificial Intelligence (AI) has moved from

Enhancing Performance with Reactive Java: A Beginner-Friendly Guide

Spread the love In today’s fast-paced software

Integrating Azure Function with Dynamics 365

Spread the love Signup on azure portal and make sure to

bluethinkinc Blogs