Multiple domains on one account?


#1

I currently have three sites: ggwsl.org, littleschool.org and baywoodelementary.org. Each is hosted on a separate account with DreamHost. They all use the same code (php).

I want to move them to one account (probably a new one named iclarke.org) and use sub-folders for the different sites, and different database names.

Is this possible?

Example of hoped for directory structure for the new account:

/phpLib <== All the common php code
/ggwsl <= www.ggwsl.org would map here
/lschool <== www.littleschool.org would map here
/baywood <== www.baywoodelementary.org would map here

Each sub-folder would only have it’s own unique index.php file.

If this is possible then I have more specific questions (basically, how? I need the step-by-step details):

  1. For example, how do I get ggwsl.org to resolve to iclarke.org/ggwsl, yet make it transparent to my users, so that their browsers still displays www.ggwsl.org and not the full path?

  2. What would be the DOCUMENT_ROOT for these subfolders?

  3. What would be the syntax for php include files or html code?

For example if I have the file: ggwsl/index.php and it wants to include /PhpLib/System.php, what is the path?

Would include( “PhpLib/System.php” ) work? Or would I be prevented from using even include( “/…/PhpLib/System.php” )?

In the case of the ggwsl site, to what would the following HTML code resolve?

Would it look in /images or ggwsl/images

  1. And if this should all work out, then what is the recommended method for migration? To create a new account, migrate existing accounts, and then delete old accounts. Or should I seek to rename an existing account, and them migrate the others?

Sorry, I could not find the detailed answer to these questions in the forum. If the answers are already posted, please direct me.

Thanks,
Ian


#2

The first thing which comes to my mind is to use remap. You can refer this article for more information.
http://wiki.dreamhost.com/KB_/Account_Control_Panel/Domains::_Remap_Sub-Dir

If you are confused by the file path after you remap those folders, maybe you can try to replace DOCUMENT_ROOT with http://yourdomain.com It should link to the right file then.

Btw, you can always create some free sub-domains and try out remap function via DH panel --> Domains --> Remap Sub-dir

Happy new year!

$50 off and 3 free domains with code: [color=#CC0000]DH3[/color] Sign Up NOW or More Codes Here


#3

Thanks for the reply!

According to the explaination for remapping sub-folders this would not achieve my desired results. If I am missing something, could you please elaborate on how to map doman names.

What I want is:

if someone enters: www.domain1.com
it resolves to user/home/myaccount.com/domain1.com

And if they enter www.domain2.com
it resolves to user/home/myaccount.com/domain2.com

From the explaination for remapping sub-folders:

if the user types: www.myaccount.com/domain1
it maps to: user/home/myaccount.com/domain1

I want to make the “myaccount” part invisible to the user.

I guess, what I want to know (rephrasing my original questions) is:
Is it possible to map a domain names to sub-folders under my account?

This would relieve my headache of having to instantiate my files to multiple accounts.

BTW - If I can do this, I’m sure I can get around the DOCUMENT_ROOT issues. In fact I will (should have) mentioned that in a separate thread. So no need to address that question.

Thanks,


#4

How about:

Create all three domains as being owned by the same user. You’ll end up with:
/home/iclarke/domain1.org/
/home/iclarke/domain2.org/
/home/iclarke/domain3.org/

Then create:
/home/iclarke/phplib/

Then I’d try to remap:
http://www.domain1.org/phplib/ to /home/iclarke/phplib
http://www.domain2.org/phplib/ to /home/iclarke/phplib
http://www.domain3.org/phplib/ to /home/iclarke/phplib

And even do the same with /images if you’d like.

-Scott


#5

Ah! Now I see it…this sounds perfect…and makes sense.

I got lost referring to the docs/discussion of mapping sub-folders and couldn’t see how to make them work.

I will contact support to see about implimenting this change to my current account (merge my three accounts into one).

…and thanks for the quick replies, this will save me a lot of headaches in the future, as I hope to add more domains!