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(
    $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');

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

  • do not modify the code in the index.php It might get overwritten when upgrading Magento Feb 21, 2019 at 14:01
  • It seem to be htaccess modification solved my problem with SetEnv Feb 21, 2019 at 14:40


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.