I am trying to have two different store views with different themes but has the same catalog and settings.
default store view: website.co.uk second store view should have: migrate.website.co.uk
Both the store views share the same website and store. it is only the front end which changes.
I have created a sub domain of the main domain I have copied .htaccess and index.php from website.co.uk to migrate.website.co.uk and modified index.php file as below:
<?php
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'migrate';
$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);
?>
replacing
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app);
.
I have also added two lines at the start of htaccess file:
SetEnvIf Host .migrate.website.co.uk. MAGE_RUN_CODE=migrate SetEnvIf Host .migrate.website.co.uk. MAGE_RUN_TYPE=store
when check the migrate.website.co.uk it shows me a blank page with 500 error. what is wrong in the code?