Magento Forum

Multiple Domain Names
 
Mootrealm
Sr. Member
 
Avatar
Total Posts:  150
Joined:  2007-09-14
San Francisco, CA
 

I have read all the documentation on multiple websites but information regarding using multiple domain names is missing. I realize all the steps are the same but usually domains live in their own directories. Media Temple for example is set up this way.

/domains/my-domain/html/
/domains/my-other-domain/html/

so i move index.php and .htaccess to the other domains folder, but index.php needs to access magento in the other domains folder. How is this done?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

in index.php you have a line

include_once "app/Mage.php";

You will need to change it to

include_once "/domains/my-domain/html/app/Mage.php";

And then all your domains will find Magento’s application files smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mootrealm
Sr. Member
 
Avatar
Total Posts:  150
Joined:  2007-09-14
San Francisco, CA
 

I don’t think that will work because those folders live outside the web root for that domain.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Why not, as long as this shared magento folder and files are readable for all, and /media and /var are writable for all?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mootrealm
Sr. Member
 
Avatar
Total Posts:  150
Joined:  2007-09-14
San Francisco, CA
 

I must not be explaining it right. the domain folders are not accessible via the web, therefore you can’t use a normal path.

This is a web site
/domains/my-domain/html/

the web root is /html/

that is as far as you can dig down from a web root folder. if i used ...

/domains/my-domain/html/app/Mage.php

it would look for

/domains/my-domain/html/domains/my-domain/html/app/Mage.php

I need to get to the server level in order to access the other domain name.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Oh you mean in case when each domain is chroot jailed?

I think it’s still possible to have shared folder that all domains have access to, via mount or symlink. Not sure though.

If this is not possible, you can have separate copy of magento for each domain which access the same database.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mootrealm
Sr. Member
 
Avatar
Total Posts:  150
Joined:  2007-09-14
San Francisco, CA
 

i thought there would be a way to using some php server root code. I just don’t know enough about php.

Also, when creating a website, store, and store view, it is a little unclear what ‘code’ means and ‘name’ for each of them. how should they be named. Screen shots are attached.

Image Attachments
1.png2.png3.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
Mootrealm
Sr. Member
 
Avatar
Total Posts:  150
Joined:  2007-09-14
San Francisco, CA
 

Still looking for an answer to this. I think this is an important topic because Megento claims it can work with multiple domain names. This is only true if hosting providers put other domain folders in the web root. In my experience most don’t, and really shouldn’t because you don’t want to be able to browse another website from another website.

Furthermore, Media Temple is a partner, but under their hosting, multiple domain names will not work.

Also, I still don’t understand what ‘code’ is.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

code is a system name for a website, store group or store view, which should start with a letter (a-z) and contain only letters, digits and underscores (a-z, 0-9, _)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mootrealm
Sr. Member
 
Avatar
Total Posts:  150
Joined:  2007-09-14
San Francisco, CA
 

... but what is it used for?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dock05
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2008-04-06
Zutphen, NL
 

What you can do is set up a domain as what some hosters call a add-on domain. These are often linked to the same directory as the original. With an .htaccess or PHP file you can determen which shop has to be loaded. I have seen an example on this forums.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mootrealm
Sr. Member
 
Avatar
Total Posts:  150
Joined:  2007-09-14
San Francisco, CA
 

That is not how Media Temple works. Each has it’s own folder.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dock05
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2008-04-06
Zutphen, NL
 

do you have plesk or directadmin or another controlpanel. I just checked for Plesk and there you have to add an Domain Alias. This should point to the same directory. In DA it is called an Domain Pointer. You just “point” the domain to the other domain.

Edit: Just searched in the knowledge base of MT and found the following:
http://kb.mediatemple.net/article.php?id=063

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