Web Hosting Talk







View Full Version : Domain Alaising (maybe)


just1post
01-28-2002, 07:13 PM
Is it possible to alais a domain to another. e.g. domain1.com and domain2.com both go to /home/sites/domain1.com/web ?


P.S. I have searched for "domain alais" returning no results, and "domain" returns over 700 results :(

Thanks!

CmptrWz
01-28-2002, 07:54 PM
Add DNS for Domain 2 to Domain 1's IP, then add domain 2 to domain 1's virtual site aliases. It will re-direct to domain 1 though. If you want domain 2 to not re-direct then I think you need to do some config file editing.

bobbyt
01-31-2002, 12:25 PM
If you're using a raq4, simply adding an A record to the correct IP and adding domain2 in domain1's mail and web aliases field (under site settings) will fix this.

If you're using an older raq, you'll have to Add an A record,
ssh into your machine and pico -w /etc/httpd/conf/httpd.conf
hit ctrl+w, type in domain1.com and hit enter

and Just under the line that reads 'ServerAlias domain1.com' add the lines:
ServerAlias domain2.com
and
ServerAlias www.domain2.com

Ctrl+X, Y, now restart apache:
./etc/rc.d/init.d/httpd restart
It will now accept web connections on both domains for the same site.

If you want domain2 to accept mail too:
pico -w /etc/virtusertable
and scroll down to where it says
"# accept-email-at-domain routes"
and add the line:
@domain2.com %1@www.domain1.com
Ctrl+x, Y

Type "makemap hash /etc/virtusertable.db < /etc/virtusertable". Now email coming into user@domain2.com will be translated to user@domain1.com and sendmail will look for the next matching record and handle it accordingly.