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

Multiple sites (question)
 
june23
Jr. Member
 
Total Posts:  30
Joined:  2008-04-18
 

Hi there,

I have a question about multiple sites, maybe I missed something on the documentation but I’m just gonna ask if what is the BEST WAY to do if I want to have 2 or more websites on the same server that shares the same products and data.

Do I have to install magento once and create a multiple site and point the unique domain on each one?

OR

Do I have to install magento in each one of the domains and just share the database so that I will have the same data?

I just need to know if what is the MOST recommended way to do this and also just curious if what are the advantages and disadvantages of each way.

Thanks in advance for your attention to this matter.

 
Magento Community Magento Community
Magento Community
Magento Community
 
iiNTENSE
Guru
 
Avatar
Total Posts:  432
Joined:  2008-11-06
Lansing, MI
 

Magento does allow you to run multiple stores under the same database, however they would be under the same domain name.  If you wanted a seperate domain name for each one, you would have to install magento on multiple servers and then import/export your products to each one.

 
Magento Community Magento Community
Magento Community
Magento Community
 
laurent
Member
 
Total Posts:  75
Joined:  2007-08-31
Paris, France
 
iiNTENSE - 25 November 2008 11:50 PM

Magento does allow you to run multiple stores under the same database, however they would be under the same domain name.  If you wanted a seperate domain name for each one, you would have to install magento on multiple servers and then import/export your products to each one.

False, Magento allows you to have mutiple websites (and multiple domain names) on the same installation. But you’ll have only one back-end. If this is what you want, this solution is, by far, the simplest.

 
Magento Community Magento Community
Magento Community
Magento Community
 
iiNTENSE
Guru
 
Avatar
Total Posts:  432
Joined:  2008-11-06
Lansing, MI
 
laurent - 26 November 2008 08:11 AM

iiNTENSE - 25 November 2008 11:50 PM
Magento does allow you to run multiple stores under the same database, however they would be under the same domain name.  If you wanted a seperate domain name for each one, you would have to install magento on multiple servers and then import/export your products to each one.

False, Magento allows you to have mutiple websites (and multiple domain names) on the same installation. But you’ll have only one back-end. If this is what you want, this solution is, by far, the simplest.

False....

The files are hosted on one server.  For an example, let’s say your initial install is on mysite.com.  All stores would have to link up to the files on mysite.com.  So if you wanted another domain name linked, you could; however it would have to be rerouted to the mysite.com server.  Which in essence, you could have a reroute of mysite2.com go to a store within the mysite.com server, but in the end, the URL would be the mysite.com server.

 
Magento Community Magento Community
Magento Community
Magento Community
 
laurent
Member
 
Total Posts:  75
Joined:  2007-08-31
Paris, France
 

The files are hosted on one server.  For an example, let’s say your initial install is on mysite.com.  All stores would have to link up to the files on mysite.com.  So if you wanted another domain name linked, you could; however it would have to be rerouted to the mysite.com server.  Which in essence, you could have a reroute of mysite2.com go to a store within the mysite.com server, but in the end, the URL would be the mysite.com server.

I don’t understand you point. Multiple domain names can point to the same IP…

I got 1 server, 1 IP and multiple domain names pointing to that IP, lets say domain1.com and domain2.com
I got 1 apache web server with multiple virtual hosts. (DomainName domain1.com and domain2.com)
I got 1 Magento installation with 1 index.php running the right web site depending on the server name.

So, my point is, YES, you can have multiple websites on one server (and one IP) with a single magento installation.

 
Magento Community Magento Community
Magento Community
Magento Community
 
angeles
Jr. Member
 
Total Posts:  3
Joined:  2008-12-17
 

Laurent! i belive you, and i want to do that.
i have 1 installation, 2 stores, 2 domains in the same server. Now, my question is that i don’t know how to point the second store to the second domain. Could you please guide me trought that?
Thank you very much

 
Magento Community Magento Community
Magento Community
Magento Community
 
MassDigitalMedia
Sr. Member
 
Avatar
Total Posts:  83
Joined:  2009-02-19
Leominster, MA
 
angeles - 16 February 2009 04:51 AM

Laurent! i belive you, and i want to do that.
i have 1 installation, 2 stores, 2 domains in the same server. Now, my question is that i don’t know how to point the second store to the second domain. Could you please guide me trought that?
Thank you very much

First, point both domains to the same place. I use Cname for the server. Then in your index.php, replace

Mage::run( );
at the bottom of the page with:
$host explode(':'$_SERVER['HTTP_HOST']);
switch (
$host[0]{
case 'www.store2.com':
  
$store 'store2';
  break;
 
default:
  
$store 'store1';
}
 
Mage
::run($store);

Obviously replacing the domain and the store names with your actual store codes from the Magento Admin --> Manage stores panel. Hope this helps!

 
Magento Community Magento Community
Magento Community
Magento Community
 
shin_mangaman
Member
 
Total Posts:  55
Joined:  2008-09-17
 

@"LAChoppers_Tech. YOU SAID:

First, point both domains to the same place. I use Cname for the server.

HOW CAN I DO THIS?!?!???! THANK YOU BYE BYE!!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
MassDigitalMedia
Sr. Member
 
Avatar
Total Posts:  83
Joined:  2009-02-19
Leominster, MA
 

Make a CName in your DNS so they both point to the same server.

Example: your server is server1.domain.com

Your websites are http://www.site1.com and http://www.site2.com
the CName for each of the domains points to server1.domain.com

Then add the code I posted above…

 
Magento Community Magento Community
Magento Community
Magento Community
 
finch8243
Sr. Member
 
Total Posts:  79
Joined:  2007-08-31
 

I have a follow-on question/idea on this: wouldn’t this be possible via .htaccess redirect or an apache symbolic link?

IOW, I have http://www.website1.com and http://www.website2.com and if you view source, all the images and skins and things are linked to http://www.MyMagentoServer.com/magento/ If want to hide the location of Magento server and make it look to the browser as if all my skins and image data is hosted on website1.com and website2.com, could I just write some htaccess code that does:

{{change any links to http://www.website1.com/mage/media/image1.jpg ==> http://www.MyMagentoServer.com/magento/media/image1.jpg }} ??

I’m not sure how to code this, any mod rewrite help would be appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
finch8243
Sr. Member
 
Total Posts:  79
Joined:  2007-08-31
 

I have a follow-on question/idea on this: wouldn’t this be possible via .htaccess redirect or an apache symbolic link?

IOW, I have http://www.website1.com and http://www.website2.com and if you view source, all the images and skins and things are linked to http://www.MyMagentoServer.com/magento/ If want to hide the location of Magento server and make it look to the browser as if all my skins and image data is hosted on website1.com and website2.com, could I just write some htaccess code that does:

{{change any links to http://www.website1.com/mage/media/image1.jpg ==> http://www.MyMagentoServer.com/magento/media/image1.jpg }} ??

I’m not sure how to code this, any mod rewrite help would be appreciated.

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