I need to create many different magento 2.3 shops as subdomains of the main shop www.domain.com; eg shop1.domain.com, shop2.domain.com, shop3.domain.com, shop3.domain.com
All those subshops will share the exact same content, products and storeviews (content in different languages using subdirectories /en /fr /de etc) of the main domain and my goal is to not create a different magento website or magento storeview for each of such subdomains. I'll customize just some graphic of the subdomains by loading a different theme/css based on the HTTP HOST env variable.
Can you tell me how to achieve this?
I've now configured nginx so that all the subdomains are mapped to the same document root, but when now I load a.domain.com I get automatically redirected to www.domain.com
In my index.php I've added the lines below before ($bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);):
case 'shop1.domain.com': $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = '<default_storeview_code>'; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store'; break; }
I want that if I type shop1.domain.com in the browser address bar I'm not redirected to the main url set for the storeview www.domain.com (this is my current problem).