CNAME and subdomain

webaltern

Verified User
Joined
Feb 10, 2008
Messages
167
Location
Québec, Canada
Hi!

i want to make a cname from subdomain1.server1.com (hosted on another server with DA ) to subdomain2.server2.com (on my server with DA). I have created the CNAME from server1 to server2, but the cname didn't work... each time i try to go to subdomain1.server1.com i arrive on the apache test page on server2....
 
Apache works with virtualhosts.
When you want a domain to react like another one, you can't just modify the DNS address: Apache must know that subdomain1.server1.com is an alias for subdomain2.server2.com and this is done by modifying the VirtualHost directive of subdomain2.server2.com.

See http://httpd.apache.org/docs/2.2/mod/core.html#serveralias

This may be a little complicated to do in DA since the ServerAlias is already included in the virtualhost template, you should copy the virtualhost2.conf template in custom/ and modify it accordingly, and since the template would make the modification for every virtualhost you will have to use an "if".
I suggest you do a simple redirection instead, it's more simple and more search-engine-friendly. Just put the DNS as it were and create an HTTP redirect with DA for subdomain1.server1.com to http://subdomain2.server2.com/
 
Last edited:
Back
Top