0

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.

asked Nov 9, 2016 at 14:29
1
  • Did you solve the issue? @lee murphy Commented Jan 3, 2019 at 12:29

1 Answer 1

0

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');
answered Nov 16, 2016 at 3:40
1
  • Thanks, tired this but afraid getting the same results as before Commented Nov 16, 2016 at 9:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.