So this is the problem I'm having.
1) I created the website, store and store view.
2) In the index.php file I have put the following code:
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'test';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app);
Question: do I add the store code to the domain name (e.g. test.exampledomain.com) or just add the store code like above?
3) In my htaccess file under the section
## enable rewrites
Options +FollowSymLinks
RewriteEngine on
I've put the following code:
SetEnvIf Host .*http://localhost/magento2.* MAGE_RUN_CODE=test
SetEnvIf Host .*http://localhost/magento2.* MAGE_RUN_TYPE=website
4) I've tried this with domain names on a live site and on a dev localhost but can't seem too get the second store/site to show up I keep getting a 500 error. Is there something else I need to add or change?
like Vhost?
Can some explain what I'm doing wrong, I have gone through endless blogs and tutorials and still can get it to work.
In magento 1, you simply make the changes to the index.php file and the stores work with the set domains.