Web Hosting Talk







View Full Version : Pointing 2nd Domain to Subdomain


Nology
10-02-2003, 07:56 AM
I have a client who has an IP based site using [domain1.com]

I have setup a subdomain [sub.domain1.com] which my client wishes to point a second domain [domain2.com] to the subdomain [sub.domain1.com].

Is this possible in Ensim or should it be done differently rather than using a subdomain?

Any help would be greatly appreciated. :)

Romanticus
10-02-2003, 08:19 AM
I think this problem can be solved by apache mod_rewrite mechanism.

Nology
10-02-2003, 08:26 AM
I'm sorry, I'm not that familiar with apache mod_rewrite, would you have any instructions to follow?

Nology
10-03-2003, 07:34 AM
Anyone else got some pointers about how to do this?

EDIT > Can this be done with DNS?

piramida
10-03-2003, 09:08 AM
you have to point the domain2 to the same ip where sub.somain1 is pointed; after that it's all a matter of configuring httpd.conf correctly.

You can either use mod_rewrite or (simpler and faster) just add SiteAlias for the sub.domain1's VirtualHost (this way, users coming to domain2.com would get contents of sub.domain1.com but they will see domain2.com in the URL). Also, you can create a Redirect that would change the URL string from domain2 to sub.domain1 if that's what your client needs.

In general, read Apache core docs on Redirects and SiteAlias.

Nology
10-03-2003, 09:14 AM
Thanks piramida, I'll give it a shot.