I have 2 stores with 2 different domains, domain2 is created as alias
Changed base links and base url's in both stores to match corresponding domains. also added following code to index.php:
$params = $_SERVER;
$domain2store = array(
'domain1'=>'default',
'domain2'=>'store2'
);
if(isset($domain2store[$_SERVER['HTTP_HOST']]))
$storecode = $domain2store[$_SERVER['HTTP_HOST']];
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = isset($storecode) ? $storecode : '';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app);
everything works just fine on first store which is also default. but on second store product images are showing default no-image. so if in backend product has 3 images - i get 3x no-image on frontend.
css, js and static(wysiwyg) images are loaded fine in second store ( domain ) and if i use products in static blocks i do see normal product images. but on product detail page all product images are shown as no-image