Need to create websites, stores and stores views from Magento admin

Main website:
Magento already creates the main website while we installing.

Website One:
Store -> All stores -> Create Website -> set website code whatever you want, in this tutorial we set webiste_code as websiteone
Store -> All stores -> Create Store -> set store code whatever you want, in this tutorial we set store_code as storeone
Store -> All stores -> Create Store View -> Assign to storeone -> Status must be enabled

Website Two:
Store -> All stores -> Create Website -> set website code whatever you want, in this tutorial we set webiste_code as websitetwo
Store -> All stores -> Create Store -> set store code whatever you want, in this tutorial we set store_code as storetwo
Store -> All stores -> Create Store View -> Assign to storetwo -> Status must be enabled

Similarly, we can create n number of websites, stores and store views.

After that we need to update the base url for the created website and stores.
1. local.main.com – which is main website
2. local.websiteone.com
3. local.websitetwo.com

After that, we need to create vhost for the above-created websites in /etc/apache2/sites-available/local.main.com.conf

After creating the above file we need to enable the vhost by running the below command.

After that, we need to restart the apache server to changes gets reflects.

The final step, we need to map our hostname with our IP in /etc/hosts, in my case it is 127.0.0.1

That’s all, open the websites URL in the browser. If you configuring everything correct, you can access the all the websites.

 

About Bilal

I'm a software programmer, I handle Magento2 modifications at any level.

View all posts by Bilal →

Leave a Reply

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