Page 1 of 1

Multiple domains; each domain-root in own folder in root??

Posted: Fri Dec 28, 2007 5:22 am
by potato
Hi,

i know, strange topic subject, but i really cant find another way to say it :s

Here is the problem where i'm stucked as hell:

i have a hosting-package where i want to use multiple domains on the same account.
Till here, no problem, i use directadmin and can add a domain pointer (as alias)
After done this, i can access my site from maindomain.com & extradomain1.com & extradomain2.com

Its complete the same, he uses the same root for the 3 different domainnames.
So now i see the same site on different domainnames.

BUT ... what i want to do is the following:

find a way so that if i open extradomain1.com, i actualy see maindomain.com/extradomain1folder
and the same for extradomain2.com, i want it so that i see maindomain.com/extradomain2folder

i'm not talking about a redirect, the goal is to have the url in the browser not showing the folder name

example:
i opened extradomain1.com, i want the url to stay extradomain1.com but i want to see the maindomain.com/extradomain1folder

With other words, i want to change the root of the domain aliases to a folder on the maindomain


I hope you understand it, its difficult to explain for me.

Any thoughts on how to get to this point would be very appreciated.


greetings,
tom

Posted: Fri Dec 28, 2007 10:51 am
by alex.w474
Use mod_rewrite: http://httpd.apache.org/docs/1.3/misc/rewriteguide.html
What you want to do is similar to "Mass Virtual Hosting" in this guide.

Posted: Fri Dec 28, 2007 12:23 pm
by potato
ALLELUJA!!

big big thankyou, i worked serveral hours at it, trying to do this with the htaccess file.
And indeed with making extra virtualhosts in the httpd.conf file of the user, it now works smoothly

THANKYOU!!!

Posted: Sat Dec 29, 2007 7:59 am
by timvw
mod_rewrite is not even needed here... Simply set the DocumentRoot for each VirtualHost to the correct folder...