Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Setting up Magento 1.4.1.1 Multisite
 
veracious
Sr. Member
 
Total Posts:  114
Joined:  2010-09-19
 

I am going to write a step by step for this once I get it working because there is limited info on this.
For clarification lets refer to the main site where the files and DB are hosted as domain1.com and the sister site will be called domain2.com

I have followed various bits of information I have found on the web for this.  I have created a new root category for the new store as well as setup the 2nd site in the admin and changed the BASE URL to http://www.domain2.com/

In short my question is for a multisite setup how are you supposed to tell domain2.com to work with domain1.com?

I have seen this entry for the .htaccess file a few times:

RewriteCond %{HTTP_HOST} ^(.*)domain1.com$
RewriteRule ^ - [E=MAGE_RUN_CODE:code]

(code is the name of the code u specified in admin when setting up domain2.)

Not sure if I was supposed to put this in domain1 or domain2’s .htaccess file.  I assumed domain2.  When that didn’t work for the heck of it I tried putting it in domain1’s .htaccess file and that forwards you to domain2.com when you visit domain1.com so I removed it. 

In short my question is for a multisite setup how are you supposed to tell domain2.com to work with domain1.com?

 
Magento Community Magento Community
Magento Community
Magento Community
 
DaveTheMage
Member
 
Total Posts:  46
Joined:  2010-10-26
 

Voracious,

I’m just in the middle of trying the same thing.  Here’s where I’ve got to so far…

Catalog->Manage Categories…
... create a new root category for Domain2

System->Manage Stores…
... create a Website for Domain2 (note the ‘Code’ you enter here, as you’ll need it later)
... create a Store for Domain2 (set its root category to the new Domain2 root category)
... create a Store View for Domain2

CMS->Pages…
... add New Page.
...... Title=Domain2 Homepage;
...... URL_Key=domain2_home;
...... Store View=Domain2 Store View (as created above)
... put some Content into the page to identify it.

System->Configuration…
... choose the Domain2 Website from the ‘current configuration scope’ drop-down list

System->Configuration->General->Store Information…
... untick ‘use default’ for Store Name, and enter the Domain2 store name

System->Configuration->General->Web->Unsecure…
... untick ‘use default’ for Base Url, and enter the Domain2 url (eg. http://domain2.com/) - don’t forget the trailing slash!

System->Configuration->General->Web->Secure…
... untick ‘use default’ for Base Url, and enter the Domain2 url (eg. http://domain2.com/ or https:// if you have one)

System->Configuration->General->Web->Default Pages…
... untick ‘use default’ for ‘CMS Home Page’ and select the new page from the drop-down

System->Configuration->General->Web->Session Cookie Management…
... untick ‘use default’ for ‘Cookie Domain’ and enter eg. ‘http://domain2.com’

This has got the Admin side of Magento configured to recognise and use the new domain. Now we need to create the files to make it work when we browse to it…

Copy index.php from the Magento folder on Domain1 to the Magento folder on Domain2

Edit index.php on Domain2…
... on about line 45, change the path to ‘app/Mage.php’
...... e.g. $mageFilename = ‘/var/www/vhosts/Domain1.com/httpdocs/app/Mage.php’;

... just before the last line i.e. Mage::run($mageRunCode, $mageRunType); put…
...... $mageRunCode = ’DOMAIN2 WEBSITE CODE FROM ABOVE‘; $mageRunType = ‘website’;

Okie dokey, that’s what I’ve got set up, and it’s working for me.  My ‘domain2’ is a subdomain, and at the moment it has no layout or css showing on it because I haven’t copied the appropriate folders from my Domain1 into Domain2 yet.

The above process wont work for ‘Parked Domains’ though, for them you’ll need to apply one of the other methods as they all try and access the same index.php file.

Hope that helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
DaveTheMage
Member
 
Total Posts:  46
Joined:  2010-10-26
 

Just came across this walkthrough which is pretty much word for word for what I said, but also goes into a lot more detail for other setups.  Well worth a read.

http://www.crucialwebhost.com/blog/how-to-setup-multiple-magento-stores/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Macsimice
Jr. Member
 
Total Posts:  7
Joined:  2010-02-19
 

There’s an updated version of that post for 1.4 and up:

http://blog.baobaz.com/en/blog/setting-up-magento-with-multiple-websites-or-stores

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top