Вопрос

How can i get different domains name for different stores created. Created store name as French its domain name should be fr.domainname.com.Thanks in advance..

Это было полезно?

Решение

Step 1: Create websites


  1. In your Magento backend, go to

Stores > Settings > All Stores

enter image description here

  1. On the Stores page, click Create Website.

enter image description here

  • Name: Enter a name to identify the website.
  • Code: Enter a unique code; for example, if you have a French store, you can enter
  • french
  • Sort Order: Enter an optional numerical sort order.

  1. Click Save Web Site.

  2. Repeat these tasks as many times as necessary to create your websites.


Step 2: Create stores

  • In your Magento backend, go to Stores > Settings > All Stores.
  • On the Stores page, click Create Store. enter image description here

Web Site: Select the website with which to associate this store. Name: Enter a name to identify the store. Root Category: Select the root category for this store.On the Stores page, click Create Store.

  • Click Save Store.
  • Repeat these tasks as many times as necessary to create your stores.

Step 3: Create store views


  • In your Magento backend, go to Stores > Settings > All Stores.
  • On the Stores page, click Create Store View. enter image description here

Store: Select the store with which to associate this store view.

Name: Enter a name to identify this store view.

Code: Enter a unique name to identify this store view.

Status: Select Enabled.

Sort Order: Enter an optional numerical sort order.

  • Click Save Store View.

  • Repeat these tasks as many times as necessary to create your store views.


Step 4: Change the website’s base URL

  • In your Magento backend, go to Stores > Settings > Configuration. Under General section, click Web.

  • From the Store View list at the top of the page, select a website.

  • Expand Base URLs section.

enter image description here


Step 5: Add the store code to the base URL

Magento gives you the option to add the store code to the site’s base URL, which simplifies the process of setting up multiple stores. Using this option, you don’t have to create directories on the Magento file system to store index.php and .htaccess.

This prevents index.php and .htaccess from getting out of sync with the Magento codebase in future upgrades.

  • In your Magento backend, go to Stores > Settings > Configuration. Under General section, click Web.
  • From the Store View list at the top of the page, select Default Config.
  • Expand Url Options section.

enter image description here

  • Uncheck the Use system value box next to Add Store Code to Urls. Then set this to Yes.
  • Click Save Config.
  • If prompted, flush the Magento cache. (System > Cache Management).

Step 6: Change the default store view’s base URL

You must perform this step last because after it’s done, you’ll lose access to the Magento Admin; your access returns after you set up virtual hosts as discussed in the web-server-specific topics.

  • In your Magento backend, go to Stores > Settings > Configuration. Under General section, click Web.
  • From the Store View list at the top of the page, select Default Config. Expand Base URLs section.
  • Enter your website’s base URL. For example: https://www.example.com/ Click Save Config.

Step 7: It’s done! You have successfully set up multiple websites and stores in Magento 2

Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top