Web Hosting Talk







View Full Version : CNAME for Subdomain?


JustinK
11-08-2001, 09:40 PM
I'm tinkering with stuff which hopefully won't kill anything... *coughs*

Anway, I'm in WHM's dns editor for one of my domains and I'm trying to get a cname to point to a subdirectory. I don't know if this can be done though since the only samples I've seen anywhere are to either just a domain or to another subdomain.

mod 14400 IN CNAME domain.com/subdirectory.

the domain and subdirectory exist, I just didn't feel like using the actual domains for no apparent reason. :) If anyone could help (that includes just telling me it's not possible if it's not so I don't spend my life working for an impossible cause) I'd greatly appretiate it.

And if anyone's wondering why exactly I'm trying to do this, it's because cpanel doesn't let you choose the directory that the subdomain points to and therefore I'm seeking simplistic alternative routes so that I can choose the directory.

erik
11-08-2001, 10:24 PM
It's not possible ;)

(You will need to set up the subdomain in Apache and redirect
it with Apache's redirect function.)

Palm
11-08-2001, 10:56 PM
You can just set the DocumentRoot to any dir you want.

JustinK
11-08-2001, 11:02 PM
I don't think I have access to that stuff... *pounds head* ok. Well thanks for telling me. I can stop trying that now. ::clears out the cname in whm:: Guess I'll just have to wait for nocsoft and cross my fingers. :)

taz0
11-09-2001, 08:02 PM
You can't do that.

You must first create the CNAME in the DNS.

subdomain IN CNAME www.domain.com.


Then create a virtual host in Apache for subdomain.domain.com.
It's there where you put your Document Root (subdomain directory)