0

I created a multi store but I have a problem.

I use magento 1.9.2.2 - can you tell me if i need to modify the index.php and the htaccess?

I modified the htaccess as follows:

SetEnvIf Host www\.magento\.zweitedomain\.de MAGE_RUN_CODE=neuestorecode
SetEnvIf Host www\.magento\.zweitedomain\.de MAGE_RUN_TYPE=website
SetEnvIf Host ^magento\.zweitedomain\.de MAGE_RUN_CODE=neuestorecode
SetEnvIf Host ^magento\.zweitedomain\.de MAGE_RUN_TYPE=Website

The second domain points to the mainserver via a-Record and IPv4. But it doesnt work!

Do I need to make other changes? I read that the domain should Point to the document_root of the main store - is the way via a-Record enough?

I also tried to Change the index.php and added the following code above Mage::run($mageRunCode, $mageRunType);:

switch($_SERVER['HTTP_HOST']) {
    case 'domain.de': Mage::run('MEIN_STORECODE_DE','store'); break;
    case 'zweitedomain.de: Mage::run('MEIN_STORECODE','store'); break;
    case 'www.domain.de': Mage::run('MEIN_STORECODE_DE','store'); break;
    case 'www.zweitedomain.de': Mage::run('MEIN_STORECODE','store'); break;
    default: Mage::run($mageRunCode, $mageRunType); break;

how to do setup of multi store?

5
  • Just to be sure, you did set the base url configuration for each website accordingly? Mar 20, 2016 at 19:25
  • Yes, under > Configuration > select the New Store > Web > Secure and unsecure URL i Write in the Second Domain
    – Daniel
    Mar 20, 2016 at 20:47
  • Any ideas?:(...
    – Daniel
    Mar 21, 2016 at 13:11
  • Can you explain how exactly "it does not work"? What happens when you go to www.magento.zweitedomain.de ? Mar 21, 2016 at 13:18
  • Hi, i made a mistake - it´s not magento.seconddomain. It´s a seperate Domain - so the htaccess code is SetEnv MAGE_RUN_TYPE website SetEnvIf Host \.seconddomain\.de MAGE_RUN_CODE=code of second Website If i want to open the second URL i get the Screen with the Information Welcome to Second-Domain This Website currently not exist
    – Daniel
    Mar 21, 2016 at 14:56

1 Answer 1

1

First of all, you don't need to do any changes in index.php. An example apache configuration that you can add at the top of your .htaccess file is:

SetEnv MAGE_RUN_TYPE website
SetEnvIf Host magento\.zweitedomain\.de MAGE_RUN_CODE=zweitewebsite

(if zweitewebsite is the code of your second website)

I usally don't add the ^ and $ delimiters, so that all subdomains or developer instances are matched as well as long the host contains "magento.zweitedomain.de":

  • www.magento.zweitedomain.de
  • test.magento.zweitedomain.de
  • magento.zweitedomain.de.local
11
  • Hi, i made a mistake - it´s not magento.seconddomain. It´s a seperate Domain - so the htaccess code is SetEnv MAGE_RUN_TYPE website SetEnvIf Host \.seconddomain\.de MAGE_RUN_CODE=code of second Website If i want to open the second URL i get the Screen with the Information Welcome to Second-Domain This Website currently not exist When
    – Daniel
    Mar 21, 2016 at 14:58
  • Then "Point to the document_root of the main store" is exactly what you are missing. Configure your web server that the second domain shares the document root with the first domain (this is the virtual host configuration, how exactly you do it depends on your hoster) Mar 21, 2016 at 15:13
  • Ok that means i Need to ask my actual hoster of the Shop how to share the document root of the main Website with the second Domain?
    – Daniel
    Mar 21, 2016 at 19:39
  • Yes, that would help. Mar 21, 2016 at 19:51
  • Great - i will let you know if it works after this Change - Thx !
    – Daniel
    Mar 21, 2016 at 20:09

Your Answer

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

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