[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Redirecting domain #2 to subdirectory of domain #1



Ahoy

You ask:

_____________________
We have a customer who currently has 3 domains hosted with us. They would
like to have one main domain and then have the other two domains become
mapped to separate subdirectories off the main one. The setup would be
something like:

www.domain1.com --> top-of-tree
www.domain2.com --> top-of-tree/domain2/
www.domain3.com --> top-of-tree/domain3/

Is this possible and if so where would I look to get started.
_____________________


On my RaQ2, the configs which control this is at /etc/httpd/conf/httpd.conf

Each site will have a section telling the site how to behave. All these
sections are at the bottom of the file. Each section begins "<VirtualHost
.... " and ends </VirtualHost>.

One line in that section begins thus: "DocumentRoot". This is the line which
tells the server where to find files for this domain.

So you go ahead and make your three domains. Now, let's say that when you
are done:
  domain1 becomes site4
  domain2 becomes site5
  domain3 becomes site6

Telnet in
type "su" and enter password so that you are root
type "cd /etc/httpd/conf"
<IMPERATIVE>
Before you go any farther, type this:   "cp httpd.conf httpd.conf.backup"
</IMPERATIVE>

Now, type "vi httpd.conf"

The VirtualHost DocumentRoot line for domain1 should now read
     /home/sites/site4/web
Then you edit the httpd.conf DocumentRoot line for VirtualHost domain2 so
that it reads:
     /home/sites/site4/web/domain2
and edit DocumentRoot for VirtualHost domain3 so that it reads:
     /home/sites/site4/web/domain2

Save the file, touch the file, and you are ready to go.

<IMPERATIVE>
Test immediately. If you have screwed up, type:
  cp httpd.conf.backup httpd.conf
to undo what you have wrought.

Aloha
Davis

p.s. Apache docs are much more readable than most docs.