I currently have a magento 1.9 store running on domain1.ac.uk without any issues.
I'm not getting everything ready for shop.domain2.ac.uk to display different themes and products but work via the same magento admin.
I've created a CMS page unique for shop.domain2.ac.uk. Setup via Manage Stores a new Webiste Name/Store Name and Store View Name for both domain1.ac.uk and shop.domain2.ac.uk
Updated the configuration for shop.domain2.ac.uk to have the correct base url
Added the following code to my index.php
switch($_SERVER['HTTP_HOST']) {
case 'shop.domain2.ac.uk ':
$mageRunCode = 'bpslw';
$mageRunType = 'bpsl';
break;
}
After this setup, if I go to shop.domain2.ac.uk it gives me a 404 page.
I've found questions like the following: Magento Multi-Store with Domain Alias - 404 Error on 2nd Store
However looking over the answers here hasn't helped as the CMS page for shop.domain2.ac.uk is set to display on all store views.
-
Did you solve the issue? @lee murphyzus– zus2019年01月03日 12:29:53 +00:00Commented Jan 3, 2019 at 12:29
1 Answer 1
Depending on your configuration, you can put in your virtual hosts file
SetEnv MAGE_RUN_TYPE "website"
SetEnv MAGE_RUN_CODE "bpslw"
Example:
<VirtualHost *:80>
ServerName website1.local.dev
ServerAlias www.website1.local.dev
DocumentRoot "C:\wamp\www\website\magento"
ErrorLog "logs\errors.log"
<directory "C:\wamp\www\website\magento">
SetEnv MAGE_RUN_TYPE "website"
SetEnv MAGE_RUN_CODE "webstore1_code"
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from all
</directory>
</VirtualHost>
<VirtualHost *:80>
ServerName website2.local.dev
ServerAlias www.website2.local.dev
DocumentRoot "C:\wamp\www\website\magento"
ErrorLog "logs\errors.log"
<directory "C:\wamp\www\website\magento">
SetEnv MAGE_RUN_TYPE "website"
SetEnv MAGE_RUN_CODE "webstore2_code"
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from all
</directory>
</VirtualHost>
Also, I'd be fairly certain that you could put this stuff in your .htaccess files if you are running apache with rewrites or whatever.
This last one is just a guess, but perhaps if you are going to have a switch statement, then you might try:
ini_set('MAGE_RUN_TYPE','website');
ini_set('MAGE_RUN_CODE','bpslw');
-
Thanks, tired this but afraid getting the same results as beforelee murphy– lee murphy2016年11月16日 09:36:48 +00:00Commented Nov 16, 2016 at 9:36