cancel
Showing results for 
Search instead for 
Did you mean: 

Load an additional css style sheet according to the subdomain

SOLVED

Re: Load an additional css style sheet according to the subdomain

Hello,

 

I have been able to make the subdomain work by adding this in index.php:

 

$params = $_SERVER;
$domain2store = array(
    'test.website-store.ch'=>'mbs_000001'
);

if(isset($domain2store[$_SERVER['HTTP_HOST']])) {
    $storecode = $domain2store[$_SERVER['HTTP_HOST']];
    $params = $_SERVER;
    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = isset($storecode) ? $storecode : '';
    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
    $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);

} else {
    $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
}


/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);

As it was not working by htaccess...

 

The subdomain is now working but no products are showing at all.

The products are showing on the main url.

 

I hope you can help me with that.

Mehdi