Magento is one of the best options for multi-store and multisite capabilities among the several eCommerce systems and CMSs on the market. In this article, we will provide you with an extensive guide on how to set up Magento 2 multisite.
Before getting into the process of setting up multiple websites, let us first differentiate between Magento stores and websites. People often misuse the terms “Magento Store” and “Magento website.” Although closely related which each other, they are quite different.
Magento 2 Websites vs Stores: The Difference
Magento starts the installation process by creating a website; this is, by default, known as the “Main Website.” You can set up multiple websites and stores using Magento on a single installation.
With multiple websites, you can set up each with its IP address and domain. You can have various shipping, payment, and currency choices available via the Magento website. You can insert prices into the store and share them globally using the configuration settings.
Remember that the configuration of shipping, payment, and currency choices cannot be unique for multiple stores. The configuration can only be changed at the website level. Stores under a single website can’t have different shipping, payment, or currency choices.
The primary distinction between a website and a Magento store is that the latter only contains client information and lacks product categories or individual products.
How To Set Up Magento 2 Multisite
Stating the obvious, you need two websites to set up the Magento 2 multisite feature. Once you are all set, log in to your Magento admin backend.
Step 1. Add a new Website
Go to your admin panel and navigate Stores > Settings > All Stores.
Click on Create Website. Then, follow the steps below to add your site.
- Enter the domain of the new website in the Name field.
- Enter the Code for the website. Make sure the code is in lowercase letters and any combination of letters (a-z), numbers (0-9), and the hyphen (-) character.
- Sort Order is the position of the new website in the list if necessary.
- Check the Set as Default checkbox to use the website as the default website.
- Click on the Save Website button.
- Finally, enable store and store view for this website.
Step 2. Set up your Store URLs
This process involves:
- Configuring the base URL
- Inserting the store code in the URL
- Configuring the secure base URL
2.1 Configuring the Base URL
- Go to the admin panel, then click on Stores > Settings > Configuration.
- Once your configuration page is loaded, navigate to the left panel, click on General, and select Web.
- Open the Base URL section, and enter the base URL for the store. The base URL should end with a forward slash.
- Keep the placeholder link available in the Base Link Url Field. This placeholder link is used to create relative links to the base URL. An example of the base URL section is shown below.
- To complete the configuration process, click on save config.
2.2 Inserting Store Code in URL
- Navigate to the admin panel and go to System > Settings > Configuration.
- Under General, click on the Web. Open the URL option. In the URL option, choose Yes in the dropdown available in the Add Store Code option.
- Save Config to continue.
2.3 Configure the secure base URL
- Enter the Secure Base URL in the Base URL (Secure)section.
A typical Base URL looks something like this:
http:// website.com
- Similar to configuring the base URL, while configuring the secure base URL, don’t edit the placeholder link available in the Secure Base Link URL.
- Save Configuration to finish the configuration process.
Final Thoughts
Setting up multiple websites on Magento 2 can be complicated if you are doing it for the first time. In this article, we have tried to simplify the Magento 2 multisite setup process so that you don’t have to worry about making any grave errors in the setup process. You can reach out to us if you have any Magento-related queries.