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 domains for one install without redirecting
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

This is the scenario:

One shop, multiple domains, multiple store views. So, for example, my store views are /uk and /dk, and my domains are http://www.domain1.com and http://www.domain2.com. I need that http://www.domain1.com/uk and http://www.domain2.com/uk point to the same site. I know magento can do that, and we just need to create aliases for the main domain, that’s allright.

Now, the problem is that all the links in http://www.domain2.com/uk are pointing to http://www.domain1.com/uk. I need that all links in http://www.domain1.com/uk point to http://www.domain1.com.uk, and the links in http://www.domain2.com/uk point to http://www.domain2.com/uk.

The problem here, as long as I can understand, is that we have to set static values to the web/secure/base_url and web/unsecure/base_url constants. Hence, as magento uses these values to build the links’ hrefs, all the links have the same base url, and it doesn’t take the domain the user first accessed under consideration.

Is there any ready made way to do it? Should I start digging the core files?

Thanks,

 
Magento Community Magento Community
Magento Community
Magento Community
 
sunnytekk
Jr. Member
 
Total Posts:  27
Joined:  2008-08-20
 

I have a same quesions.

Now i bought two donmains.

One(ex, http://www.my1st.com) is working now. But I don’t know how to point my second domain( ex. http://www.my2nd.com) point to it’s home page
in http://www.my1st.com/admin.  I created new home page for http://www.my2nd.com in http://www.my1st.com/admin. Thank you

Would you please give me detail comments?

Thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sting25
Jr. Member
 
Total Posts:  1
Joined:  2008-05-22
 

HI am having a similar issue 3 domains and everything looks ok in each store however the links are all to the base store.  If I change the defaults I loose the skins etc because the directories are not there… hmmmmm

Searching

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brandlive eCommerce
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2008-03-31
Buenos Aires, Argentina
 

Try this:

Go to System --> Configuration and select the store view you want to change the base url.
Then go to Web panel and specify an unsecure url base.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Scott
Guru
 
Avatar
Total Posts:  333
Joined:  2007-08-31
Northwest Ohio
 

I think what you’re really after in each of your store views in the System Configuration is the Base Link Url, which should have the non-Magento-installation URL, but rather the “alias” URL, if you will, for each store or store view. Keep Base Url as your Magento installation though, or else your theme files (skin images, js, styles, etc) won’t work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
CalinT
Jr. Member
 
Total Posts:  15
Joined:  2008-04-11
 

First define your websites and stores under System -> Manage Stores and then, provided you already parked your second domain (http://www.seconddomain.com) on top of the main domain (http://www.maindomain.com):

you will have something like:

WebsiteName   WebsiteCode
-------------------------------------------
website1         web1code
website2         web2code

// web1code is usually ‘base’

Then edit System -> Configuration -> website1 -> Web tab and :
        set {Base URL}        to your http://www.maindomain.com/
        set {Base Link URL} to your http://www.maindomain.com/

Then edit System -> Configuration -> website2 -> Web tab and :
     set {Base URL}        to your http://www.maindomain.com/
     set {Base Link URL} to your http://www.seconddomain.com/

Then edit index.php under the root folder of you maindomain and change:

    Mage::run(’base’, ‘website’);

to:

switch ($_SERVER[’HTTP_HOST’]){
    case “www.seconddomain.com”:
    case “seconddomain.com”;
        Mage::run(’web2code’, ‘website’);
       // where web2code is the code of your second website from under manage Stores -> Edit Website
    break;

    default:
       Mage::run(’web1code’, ‘website’);
}

That’s it! No add-on domains required. I have successfully handled this way 3 secondary domains (parked on top of the main domain) each featuring slightly different product catalog.

P.S. The only thing I don’t like about this set up is the img href’s, css href’s and so on point to maindomain.com for all secondary websites

Good luck

 
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
 
dansksun
Jr. Member
 
Total Posts:  11
Joined:  2009-08-09
 

Hi everyone,

I am trying to set Magento multi store on multi domain:
As mentioned here http://www.magentocommerce.com/blog/comments/video-creating-multiple-online-storefronts-part1/

the instructions are to put this line in the main page (index.php page) of the new domain.

$mageFilename = ‘../app/Mage.php’;

I am using grid server with Media Temple and for some reason this path cannot be found and I am getting this message :
“../app/Mage.php was not found”

Than I tried to give full path to the desired target library:

$mageFilename =’http://www.maindomain.com/app/Mage.php’

And I get this page message:
“http://www.maindomain.com/app/Mage.php was not found”

But when I click the link in this page I see this:
You don’t have permission to access /app/Mage.php on this server.
Apache/2.0.54 Server at http://www.maindomain.com Port 80

Thank you,
Dansk

 
Magento Community Magento Community
Magento Community
Magento Community
 
quark
Member
 
Total Posts:  60
Joined:  2007-12-15
Romania
 

Same problem with “Mage.php was not found”.
I have Plesk, CentOS 5.

 
Magento Community Magento Community
Magento Community
Magento Community
 
f8bar
Jr. Member
 
Total Posts:  19
Joined:  2009-08-10
 

or your server doesn’t met the minimum requirements or you have a problem with your permissions…

if your using linux and have root access… go to your magento main folder and type: chown -R www-data. .

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