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

Page 1 of 3
Multi store setup on different domains
 
tlelliott77
Jr. Member
 
Total Posts:  12
Joined:  2009-08-25
 

I’ve searched for this topic but can’t find anything that exactly matches / solves my problem.
I have a Magneto installation working and taking orders on http://www.store1.co.uk
I am trying to add another Magento installation on http://www.store2.co.uk on the same server.

The steps I have taken so far:

1. Created the root catalogue for the store2 website and added some products (and made sure the products are active on both

websites)

2. Created new website, store and store view in Magento

3. In Configuration for the store2 website configuration scope I have changed the WEB settings as follows:

Unsecure:
Base URL: http://www.store2.co.uk/
Base Link URL: {{unsecure_base_url}}
Base Skin URL: {{unsecure_base_url}}skin/
Base Media URL: {{unsecure_base_url}}media/
Base JavaScript URL: {{unsecure_base_url}}js/

Secure: Same as above for now

4. On the server (as root) I have created symbolic links to the app, includes, media, js, report, skin and var directories for the

main installation.
e.g. in /home/store2/public_html there is a symbolic link for app that points to /home/store1/public_html/app

5. Copied the index.php from store1 installation to the store2 directory /home/store2/public_html
I believe the $mageFilename in index.php should point to the main installation due to the symbolic links above.

6. Copied the .htaccess from the main installation to the store2 directory /home/store2/public_html
In this file I have added the following lines at the top:
SetEnvIf Host .*store2.* MAGE_RUN_CODE="store2";
SetEnvIf Host .*store2.* MAGE_RUN_TYPE="website";

From all the posts and guides I have read about setting multiple websites up, I believe this should do the trick. 

In fact I get a 404 error when I go to http://www.store2.co.uk.

This 404 page does contain an attempt to display a logo.gif
<a href="http://www.store2.co.uk/" title="Magento Commerce” class="logo"><img src="images/logo.gif" alt="Magento Commerce” /></a>,

and also a Varien copyright notice, so I assume this means it is running Mage.php rather than just unable to get to it.

There is a similar post I have found where someone says he had it working fine but got 404 error on the second domain when he

turned on URL rewrites.  Can anyone confirm if this might be the problem and whether it is possible to have 2 sites on 2 domains

but still have URL rewrites active?

Thanks in advance to anyone who can provide assistance on this. 

Tim

 
Magento Community Magento Community
Magento Community
Magento Community
 
tlelliott77
Jr. Member
 
Total Posts:  12
Joined:  2009-08-25
 

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

 
Magento Community Magento Community
Magento Community
Magento Community
 
tlelliott77
Jr. Member
 
Total Posts:  12
Joined:  2009-08-25
 

Is there anyone who knows the answer to this question?  Please, if anyone has set this up I’d love to know.  Even if you aren’t able to help me to sort mine out, at least I would know whether I’m bashing my head against a brick wall and stop.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

Perhaps this user (satish) could help

http://www.magentocommerce.com/boards/member/16196/

He does multi store stuff

 
Magento Community Magento Community
Magento Community
Magento Community
 
tlelliott77
Jr. Member
 
Total Posts:  12
Joined:  2009-08-25
 

Thanks.  I got there eventually and it was frustratingly simple.

Point 5 from my original post was the problem. In the index.php the path to the Mage.php file needed to be an absolute path /home/user/public_html/app/Mage.php rather than just ./app/Mage.php

It now seems to be working - hope that helps anyone else with the same problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
clixwear
Jr. Member
 
Total Posts:  13
Joined:  2009-11-11
 

Hi,
Thanks for your post, and your follow up solution - I have been researching for weeks now how to do this...and have been getting conflictign info...and honestly didn’t feel right any method - I am going to use your info for the main guidlines...I have read some info similar to what you did, but an never confirm if I need to copy the index.php and htaccess etc…

I too want to different set ups, one domain in one server account (different IP) , than the current install
with url-rewrites on.
shared default category/catalog (although I already have products and have to manually go into every product and change it so they show in the other website)

I have created new website, new store, new store view
I have also changed by base urls, and seccure urls
I was just about to try creating symbolic links via ssh…

Is there any particular things or posts you may want to bring to my attention?

btw, your version is 1.4. right so is mine?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
magestore
Mentor
 
Avatar
Total Posts:  1015
Joined:  2009-08-07
Viet Nam
 

Hello
Many people use my tutorial to create multiple stores with different domains.
http://www.magestore.com/blog/2010/04/12/how-to-setup-multiple-websites-multiple-stores-in-magento-1-3
Also, remember to choose a good hosting for Magento to make sure that your multiple store site run smoothly, take a look at this Magento Hosting review
Hope this help

 
Magento Community Magento Community
Magento Community
Magento Community
 
clixwear
Jr. Member
 
Total Posts:  13
Joined:  2009-11-11
 

I can\’t seem to get the new store to work...and I have a bunch of questions

I have read many, many blogs , comments, and official magento wiki guides, however,

------------WOULD LIKE-------------

1) i still dont have an uptodate (v1.4) guide to set up two stores, with two different domains, different root folders and different IPs, that will have two SSL certs,
so one install, to run two different domains, and the customer never shares the doamin names - meaning if he checksout at one domain he stays there

--------MY INFO & CHANGES SO FAR---------------------

the two doamins are:

clixwear.ca
clixwear.com

clixwear.ca has the original install

I have VPS server Servint

(would this be called the Add on Domian Method with different document root ?)

I have added the new website, store, and storeview in my admin,

I have changed the secure and unsecure base URL for the second website to http://www.clixwear.com/

I currently do have URL rewrites on (in admin)

--------------IN QUESTION------------------

Here are the parts I\’m not sure of (one guide doesn\’t even mention it, the other does!?!)

A) I have created symbolic links, but some giudes have pre v1.4 folders, but I think I got the right ones - can anyone verify which folders need to have symbolic links

B) DO I copy the index.php from the original install to the new websites root directory AND CHANGE/EDIT the the lines:

$mageFilename = ‘/home/myuser/public_html/app/Mage.php’; (full paht) and should the full path be

and do I add anything to:

$mageRunCode = isset($_SERVER[\’MAGE_RUN_CODE\’]) ? $_SERVER[\’MAGE_RUN_CODE\’] : \’\’;
$mageRunType = isset($_SERVER[\’MAGE_RUN_TYPE\’]) ? $_SERVER[\’MAGE_RUN_TYPE\’] : \’website;

is it supose to be:

$mageRunCode = isset($_SERVER[\’MAGE_RUN_CODE\’]) ? $_SERVER[\’MAGE_RUN_CODE\’] : \’clixwear_com\’;
$mageRunType = isset($_SERVER[\’MAGE_RUN_TYPE\’]) ? $_SERVER[\’MAGE_RUN_TYPE\’] : \’website;

were clixwear_com is my website code (and for both the store view too)

C) here is the fun part...what the heck do you actually do with the htaccess

-do you copy the origianl install (from the root directory?)

and make changes?  which one is best to use??

SetEnvIf Host .*yourhost.* MAGE_RUN_CODE=\"base\";
SetEnvIf Host .*yourhost.* MAGE_RUN_TYPE=\"website\";

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

which I made for my instance:

SetEnvIf Host .*clixwear.* MAGE_RUN_CODE=\"clixwear_com\";
SetEnvIf Host .*clixwear.* MAGE_RUN_TYPE=\"website\";

Also I could use:
SetEnvIf Host http://www.domain1.com MAGE_RUN_CODE=domain1_com
SetEnvIf Host http://www.domain1.com MAGE_RUN_TYPE=website
SetEnvIf Host ^domain1.com MAGE_RUN_CODE=domain1_com
SetEnvIf Host ^domain1.com MAGE_RUN_TYPE=website

as per guide:http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup/

or
RewriteCond %{HTTP_HOST} ^(.*)site.com
RewriteRule ^ - [E=MAGE_RUN_CODE:example]

as per giude:
http://www.magentocommerce.com/wiki/multi-store_set_up/multiple-website-setup#multiple_websites_on_magento_1.4_single_installation

or
SetEnvIf Host .*site.* MAGE_RUN_CODE=example
SetEnvIf Host .*site.* MAGE_RUN_TYPE=website # \’website\’ or \’store\’

--------------Current RESUTLS--------------------

At the moment I have tried all different variations of the htaccess and index file changes - BUT not working, I get errors about

Failed opening \’Varien/Autoload.php\’ for inclusion etc, etc, (other errors too, but seem to be based on Varien/Autoload.php)

also if I refresh I turns in to a internal server error 500

-------------------------------

PLEASE SOME ONE HELP OR DIRECT ME TO SOME ANSWERS....

 
Magento Community Magento Community
Magento Community
Magento Community
 
M Floren
Jr. Member
 
Total Posts:  13
Joined:  2010-05-11
 

I am having the same issues.

2 url’s
2 hosting accounts

I ca get a second store to load just fine when it is located in a folder or sub folder of the main install (website1.com) but when i try to get it to work on website2.com all i get is /app/Mage.php was not found

very erking..

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageClub
Guru
 
Avatar
Total Posts:  386
Joined:  2009-07-25
India
 

Same here!

Our domains are outside the main site public_html , and the whole thing is not working for the multi store concept.

That sucks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MeetWebSurgeon
Jr. Member
 
Total Posts:  3
Joined:  2010-08-09
Chandigarh
 

Well.. very much similar situation.

My Magento is installed on cheapnbest.co.cc at /home/jeronone/public_html/cheapnbest

and i want the second website to run on basestation.co.cc at /home/jeronone/public_html/cheapnbest/basestation

Here is what i did:

1) Created new root category, assigned it to new website created in configuration settings.

2) Unsecure Base URL: http://cheapnbest.co.cc/
Base Link URL: http://basestation.co.cc

3) Copied index.php and .htaccess into newwebsite folder with following changes:

$compilerConfig '../includes/config.php';
if (
file_exists($compilerConfig)) {
    
include $compilerConfig;
}

$mageFilename 
'../app/Mage.php';
$maintenanceFile '../maintenance.flag';

and adding few codes to .htaccess on very top:

SetEnvIf Host .*site.* MAGE_RUN_CODE=basestation_website
SetEnvIf Host 
.*site.* MAGE_RUN_TYPE=website # 'website' or 'store'

Now…

cheapnbest.co.cc is working fine OK
cheapnbest.co.cc/basestation is opening new website page OK

but basestation.co.cc is redirecting me to cheapnbest.co.cc (THE ONLY PROBLEM)

I feel, i am doing something wrong with htaccess.

Can somebody help?

Image Attachments
Capture.PNG
 
Magento Community Magento Community
Magento Community
Magento Community
 
VSC_JOHN
Jr. Member
 
Total Posts:  6
Joined:  2011-10-13
 

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.

 
Magento Community Magento Community
Magento Community
Magento Community
 
wjohan
Member
 
Avatar
Total Posts:  46
Joined:  2011-03-08
Monnickendam
 

What i’ve done is the following:

My main domainname is http://ledking.co.uk

I linked ledworld.nl, yourledstore.co.uk, ledtown.nl, ledproduct.nl and led-profielen.nl to this main domain.

If you have yourmaindomain.com you should do the following:

- First you make a new website, which you will name accordingly to your preferences. Furthermore create a store and a storeview as well. Remember your newly created website code as you need it further on.

- Then you will make your 2nd (or third, fourth etc.) domain a domain alias of your main domain, so make http://yourseconddomain.com a domain alias of http://yourmaindomain.com, this can easily be done in Plesk or cPanel.

- Then you configure your unsecure url and secure url in system >configuration > web. Just select the just created storeview and replace the default secure url and unsecure url by: http://yourseconddomain.com

- Then you open your magento root directory via ftp and open the .htacces file and add this to your file:

############################################

##This will set the right website if visitors visit http://www.yourseconddomain.com

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

###########################################

Make sure to replace the values with the correct ones..

- Also add a theme to the new website

Now you’re finished! Just repeat the steps if you like to add more domains..

Now you have a multidomain magento setup!

Cheers,

Joey

 
Magento Community Magento Community
Magento Community
Magento Community
 
developerindia
Member
 
Total Posts:  58
Joined:  2009-06-25
 

Thanks this is work for me

############################################

##This will set the right website if visitors visit http://www.yourseconddomain.com

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

###########################################

 
Magento Community Magento Community
Magento Community
Magento Community
 
AlejandroCCS
Jr. Member
 
Total Posts:  8
Joined:  2009-03-15
 

Hello there guys,

I have been searching about this topic for a while now, but all the info I find it seems not be useful to direct me to a proper setup or I might missing something, that’s the reason I’m posting this entry.

What I want to achieve:

I want to setup magento in order manage it from one single domain (main-installation) and have multiples independent domains (websites: store1, store2, store3, store4 ) working back and forth with the database and installation of magento. All of this websites should contain a separate blog for each one, the might share some product data but not the customer data; the Frontend and Backend on the main-installation website should be only visible to the developers.

Current Setup:

Hosting in : HOSTGATOR
Server Type: VPS
OS: Linux CentOS
Magento Version: 1.6.2.0
This VPS is Using cPanel and WHM

Domains Setup: 5 Domains in it
1) http://www.main-installation.com
2) http://www.store1.com
3) http://www.store2.com
4) http://www.store3.com
5) http://www.store4.com

Each of the above domain has in the VPS it’s own account directory as follow:

/home/main-installation/public_html/
/home/store1/public_html/
/home/store2/public_html/
/home/store3/public_html/
/home/store4/public_html/

Magento is installed in:

/home/main-installation/public_html/stores/

Magento Database

Is under main-installation account

Store Setup in Magento Admin

All stores for each domain are currently setup with products associated to them.

Steps so Far:

I have try the Simbolic link’s method for this setup and I get the following error:

500 Internal Server Error

/app/Mage.php was not found

Even when I have modified the index.php file to: /home/main-installation/public_html//app/Mage.php

Also, I have made the changes to .htaccess on: /home/store1/public_html/

SetEnvIf Host .*store2.* MAGE_RUN_CODE="store2";
SetEnvIf Host .*store2.* MAGE_RUN_TYPE="website";

But I still get the same error as above.

I have tried both configurations with URL Re-Writes ON and OFF on the main-installation and still no success.

I hope someone can help solve this issue.

 
Magento Community Magento Community
Magento Community
Magento Community
 
magento123
Member
 
Avatar
Total Posts:  64
Joined:  2010-12-30
 

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

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