Magento Forum

   
Page 2 of 3
Multi store setup on different domains
 
spiyda
Jr. Member
 
Total Posts:  2
Joined:  2010-11-19
 
magento123 - 13 March 2012 10:17 PM

Hi all,

I have also set up my second store in magento. Which was successfully established
But i am having images issues on my second website. I hope anybody can help me in this
I have one main server, and under it two domains a and b

Everything is working fine on a but i am not able to see images on b

There are some extensions i have created which are working fine on both the domains. They have been able to fetch the product images completely but core magento does not. Please help

Thanks in advance smile

did you fix this ? 

I have exactly the same symptom

from what I can see, magento is calling get.php in the root of the second website.. 
and there is no virtualisation for the root..

eg

http://www.blahblahblah.com/get.php/media/catalog/product/cache/2/image/ca14aa1921bd4cc07efb1f03bc1d6554/n/e/new-9.jpg

but get.php is in the original magento installation of

http://www.original.com/magento/get.php

so a 404 is being generated..  which then fails because there is no 404 in the root of the second website either

what am I doing wrong..  ?  the rest of the site seems to be working OK

1.7.0.2

 
Magento Community Magento Community
Magento Community
Magento Community
 
spiyda
Jr. Member
 
Total Posts:  2
Joined:  2010-11-19
 

I finally found an answer to the images not showing up in the new addon domain websites

here on stackoverflow http://stackoverflow.com/questions/11578231/wrong-paths-on-multi-website-magento-install

It required a change to the path in the configuration from

Base Media URL: {{unsecure_base_url}}media/

to

Base Media URL: {{unsecure_base_url}}../media/

I don’t understand whjy it would be required for the media folder and not the javascript or skin folders… but there ‘tis

hope this helps someone else…

spiyda - 22 October 2012 03:27 PM

magento123 - 13 March 2012 10:17 PM
Hi all,

I have also set up my second store in magento. Which was successfully established
But i am having images issues on my second website. I hope anybody can help me in this
I have one main server, and under it two domains a and b

Everything is working fine on a but i am not able to see images on b

There are some extensions i have created which are working fine on both the domains. They have been able to fetch the product images completely but core magento does not. Please help

Thanks in advance smile

did you fix this ? 

I have exactly the same symptom

from what I can see, magento is calling get.php in the root of the second website.. 
and there is no virtualisation for the root..

eg

http://www.blahblahblah.com/get.php/media/catalog/product/cache/2/image/ca14aa1921bd4cc07efb1f03bc1d6554/n/e/new-9.jpg

but get.php is in the original magento installation of

http://www.original.com/magento/get.php

so a 404 is being generated..  which then fails because there is no 404 in the root of the second website either

what am I doing wrong..  ?  the rest of the site seems to be working OK

1.7.0.2

 
Magento Community Magento Community
Magento Community
Magento Community
 
adamblansett
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2012-12-15
Houston, Texas
 

Ok I have got the domain names issue straight though the only problem I am having left is the second site is just showing the main site information in the frontend even though It shows the correct domain name.

Any Ideas?

Info:
Single install
second domain name is pointing to the main domain names directory

the .htaccess file is configured properly.

they are sharing the same index.php file or I would use the correct that most are saying.

I guess I could write a switch statement for the index.php if I really need to though I was hoping there might be an easier way.

 
Magento Community Magento Community
Magento Community
Magento Community
 
WPNHost
Jr. Member
 
Total Posts:  16
Joined:  2012-11-27
 

Just wondering if anyone here who got it working could help me out over here:

http://www.magentocommerce.com/boards/viewthread/352478/

having a heck of a time and i know it must be something i am overlooking.

 
Magento Community Magento Community
Magento Community
Magento Community
 
adamblansett
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2012-12-15
Houston, Texas
 
adamblansett - 07 March 2013 04:52 PM

Ok I have got the domain names issue straight though the only problem I am having left is the second site is just showing the main site information in the frontend even though It shows the correct domain name.

Any Ideas?

Info:
Single install
second domain name is pointing to the main domain names directory

the .htaccess file is configured properly.

they are sharing the same index.php file or I would use the correct that most are saying.

I guess I could write a switch statement for the index.php if I really need to though I was hoping there might be an easier way.

I created a switch statement in my index.php file and it worked.  here is an example.
//Multi-site Provision

switch ($_SERVER[’HTTP_HOST’]) {
case “yourdomain.com”:
$_SERVER["MAGE_RUN_CODE"] = ‘your_website_code’;
$_SERVER["MAGE_RUN_TYPE"] = ‘website’;
break;
case “yourdomain.com2”:
$_SERVER["MAGE_RUN_CODE"] = ‘your_website_code2’;
$_SERVER["MAGE_RUN_TYPE"] = ‘website’;
break;
case “yourdomain.com3”:
$_SERVER["MAGE_RUN_CODE"] = ‘your_website_code3’;
$_SERVER["MAGE_RUN_TYPE"] = ‘website’;
break;
case “yourdomain.com4”:
$_SERVER["MAGE_RUN_CODE"] = ‘your_website_code4’;
$_SERVER["MAGE_RUN_TYPE"] = ‘website’;
break;
}

make the edits to “yourdomain.com” and “your_website_code” and put it right before:

/* Store or website code */
$mageRunCode = isset($_SERVER[’MAGE_RUN_CODE’]) ? $_SERVER[’MAGE_RUN_CODE’] : ‘’;

/* Run store or run website */
$mageRunType = isset($_SERVER[’MAGE_RUN_TYPE’]) ? $_SERVER[’MAGE_RUN_TYPE’] : ‘website’;

Mage::run($mageRunCode, $mageRunType);

 
Magento Community Magento Community
Magento Community
Magento Community
 
WPNHost
Jr. Member
 
Total Posts:  16
Joined:  2012-11-27
 

Thank you Adam, that looks like what basically Apache and .htaccess achieves, i am no nginx expert to know how to do such “magic”.

i went ahead this morning and set up a a whole new install, but putting my stores in separate directories and then doing an ln -s link to the main, that has my test store working, had to do it for my own sanity to see if i was missing something.

But with what you posted could save some work in having to reconfigure and integrate some custom webservices and i can remain with what we have in our test environment.

Let me test this out and i shall let you know how it goes.

 
Magento Community Magento Community
Magento Community
Magento Community
 
adamblansett
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2012-12-15
Houston, Texas
 
WPNHost - 23 April 2013 10:49 AM

Thank you Adam, that looks like what basically Apache and .htaccess achieves, i am no nginx expert to know how to do such “magic”.

i went ahead this morning and set up a a whole new install, but putting my stores in separate directories and then doing an ln -s link to the main, that has my test store working, had to do it for my own sanity to see if i was missing something.

But with what you posted could save some work in having to reconfigure and integrate some custom webservices and i can remain with what we have in our test environment.

Let me test this out and i shall let you know how it goes.

WPNHost,

I had tried the .htaccess file method as described in Magento’s documentation http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup and for some reason even though it should work in theory was not working in my case. Which is what caused me to us the index.php method as I have described.

Another note. I was using CPanel and created ‘addon domains’ pointing to the root directory. A parked domain would accomplish the same thing. Though some host limit the amount of parked domains you are allowed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
WPNHost
Jr. Member
 
Total Posts:  16
Joined:  2012-11-27
 

Luckily for me, or maybe not, this is an in house server i set up, using nginx 1.2.7, php-fpm and centos 6.4 x64.

so the htaccess method wouldn\’t work for me, i thought it was going to be pretty straight forward using the mage codes in the index.php with in each stores main directory (which are sub directories to the main root) but i was just getting 404 page not found errors when i hit anyof my sub stores on different domains.

http://www.magentocommerce.com/boards/viewthread/352478/

i am hoping though you have saved me many headaches!, i should know soon.

 
Magento Community Magento Community
Magento Community
Magento Community
 
adamblansett
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2012-12-15
Houston, Texas
 
WPNHost - 23 April 2013 11:50 AM

Luckily for me, or maybe not, this is an in house server i set up, using nginx 1.2.7, php-fpm and centos 6.4 x64.

so the htaccess method wouldn\’t work for me, i thought it was going to be pretty straight forward using the mage codes in the index.php with in each stores main directory (which are sub directories to the main root) but i was just getting 404 page not found errors when i hit anyof my sub stores on different domains.

http://www.magentocommerce.com/boards/viewthread/352478/

i am hoping though you have saved me many headaches!, i should know soon.

The VPS I am using for it is CentOS. I did try the method you are describing with no luck.

 
Magento Community Magento Community
Magento Community
Magento Community
 
WPNHost
Jr. Member
 
Total Posts:  16
Joined:  2012-11-27
 

i found some other things with the config that was set up , my test set up the website , store and store view name were all the same where as the test env ones they were all different, i am going to rename them all today and test with the subfolders route to see if it works, if not i am going to move out the sub folders into seperate directory in my web root and try that way.

if that fails, then i will set up the system from scratch as i did in my test set up that i know works and have them re-input the data.

 
Magento Community Magento Community
Magento Community
Magento Community
 
S Macfarlane
Member
 
Avatar
Total Posts:  53
Joined:  2010-10-24
Southampton
 
VSC_JOHN - 31 October 2011 10:52 AM

Whats the general verdict on this?  Is it just better to setup multiple installs than try to get this to work?  Ideally I\’m looking to run 4-5 stores off one install on my Host Gator VPS.

My store setups will be a combination of Stand Alone Domains & sub domains of our main domain.  Some products will be shared across all of them, some will be specific to certain stores.


I\’m trying to setup this on 1.6.1.0 on a Host Gator VPS.

If it\’s still doable which guide should I follow?  I keep finding a bunch of conflicting info and nothing that\’s quite up to date.

Generally speaking you only setup a multistore if you are looking to share products across different stores OR setup different mirror stores containing different curencies.

If you have 4-5 different stores you would be recommended to setup 4-5 seperate ones.

 
Magento Community Magento Community
Magento Community
Magento Community
 
WPNHost
Jr. Member
 
Total Posts:  16
Joined:  2012-11-27
 

the link you posted applies for Apache, not nginx, this is the problem Magento’s sites all work on nginx and yet there is little “complete” documentation on setting up a multi-store config to work since there is 3 or 4 different ways using sub directories, root directories et cetera.

You can also use multi-stores if you want to limit access for certain people to certain products, that is how we are doing it, we have 8 stores across 4 companies each having 2 stores which has different access to products, but we wanted the single admin point to manage it all that Magento offers.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nChannel
Guru
 
Avatar
Total Posts:  322
Joined:  2012-02-28
 

We actually have a blog post that covers this with multiple domains using our Magento integration solution.

“One of the more regular questions we see from Magento store users is how to integrate multiple Magento stores. Sometimes eCommerce merchants have separate product lines or even different languages that they would like to manage separately on the front end but have the benefit of combining on the backend.”

Full blog: http://www.nchannel.com/2012/12/19/how-to-integrate-multiple-magento-stores-using-nchannel/

Let me know if you have any questions or would like to learn more.

Darren
nChannel

800-406-8217

 
Magento Community Magento Community
Magento Community
Magento Community
 
todaytonight
Jr. Member
 
Total Posts:  3
Joined:  2013-04-21
Brisbane
 
tlelliott77 - 14 September 2010 12:15 AM

Maybe I should have asked this question in simpler terms.

Is it possible to run a multi store setup on different domains (on the same VPS) with URL rewrites active?

Thanks
Tim

It is possible. Install one store and forward another domain to the current domain.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jackaroo
Jr. Member
 
Total Posts:  4
Joined:  2011-09-18
 

Getting Multiple domains to work in one Magento installation was tricky, but thanks to two separate posts, I have got it working!

0. Follow the steps here:
(this works for subdomains):  http://www.magentocommerce.com/magento-on-the-fly/multiple-sites/

Next for different domains running under the one magento installation, do step 0 above, then do the following changes/additions:

1. in index.php
the relative path to the base folder needs to be set, on CPanel I needed a ‘/’ before the ‘../’ from the instructions in Step 0, as follows
$mageFilename = MAGENTO_ROOT . ‘/../app/Mage.php’;

2. in System|Configuration|General|Web

In the top left of the screen, select the secondDomain store you have already setup in step 0 above.

Change the settings as follows, changing the domains to your own

Unsecure
Base URL = http://www.maindomain.com/seconddomain (The ‘secondDomain’ is the folder with the copied .htaccess and index.php setup in step 0.)
Base Link URL = http://www.seconddomain.com
Base Skin URL = http://www.maindomain.com/skin/
Base Media URL = http://www.maindomain.com/media/
Base Javascript URL = http://www.maindomain.com/js/

And do the same for secure settings

2. update in .htaccess for maindomain

##this was put in automatically, but just in case:
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://maindomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://maindomain.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://seconddomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://seconddomain.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.maindomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.maindomain.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.seconddomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.seconddomain.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://maindomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://maindomain.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://seconddomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://seconddomainco.nz$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.maindomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.maindomain.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.seconddomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.seconddomain.com$      [NC]

RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

##This will set the right website if visitors visit http://www.seconddomain.com.  
##Courtesy http://www.magentocommerce.com/boards/viewthread/204802/P0/ post by user wjohan 

##yourseconddomaincode = the code you setup in Magento for the website/store/store view  part, and is the website code.

SetEnvIf Host www\.seconddomain\.com MAGE_RUN_CODE=yourseconddomaincode   
SetEnvIf Host www\
.seconddomain\.com MAGE_RUN_TYPE=website
SetEnvIf Host 
^seconddomain\.com MAGE_RUN_CODE=yourseconddomaincode
SetEnvIf Host 
^seconddomain\.com MAGE_RUN_TYPE=website

A couple of gotchas:
1.  Make sure with your products you also
a. enable them to work on the second website
b. add them to the categories for the second website

2.  In Cpanel, make sure you have ‘parked’ the second domain in you MainDomain hosting and have also set the appropriate DNS servers for the seconddomain to point to your MainDomain hosting.

3.  Also, if the logo is not showing, for some reason the logo also likes to be in the base folder of your theme.  Go figure.

4.  Make sure you clear all caches in magento and your browser if you are having problems.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 2 of 3