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.

1
  • Did you solve the issue? @lee murphy
    – zus
    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');
1
  • Thanks, tired this but afraid getting the same results as before
    – lee murphy
    Nov 16, 2016 at 9:36

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.