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

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
potato
Forum Contributor
Posts: 192
Joined: Tue Mar 16, 2004 8:30 am
Location: my lovely trailer, next to the big tree

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

Post 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
alex.w474
Forum Newbie
Posts: 3
Joined: Wed Dec 26, 2007 11:26 am

Post 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.
User avatar
potato
Forum Contributor
Posts: 192
Joined: Tue Mar 16, 2004 8:30 am
Location: my lovely trailer, next to the big tree

Post 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!!!
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

mod_rewrite is not even needed here... Simply set the DocumentRoot for each VirtualHost to the correct folder...
Post Reply