Can I point a sub domain of one site to the root of another on same server / IP

Mere Development picture Mere Development · Feb 20, 2012 · Viewed 11.7k times · Source

I have this (pseudo) domain setup, and hope to do any configuration via cPanel and/or WHM.

myclient.com - this hosts a development site and there is no public DNS for it yet (by choice) mycompany.com - this is my company's domain name and it's publicly accessible. myclient.mycompany.com - this is the domain I want to use to preview the myclient website during development.

Edit for clarity: All 3 are on the same server and same IP.

So, is it possible to point that subdomain (myclient.mycompany.com) to the webroot of myclient.com using cPanel or WHM?

I've looked at addon domains, redirects and parked domains but each of them can only relate to own account, or cannot be used with another domain if it's managed by the same server.

Any idea? :/

Answer

mauricio picture mauricio · Nov 9, 2012

I went there and did it! But not like I told earlier.

On WHM go to park a domain. Select the domain where you want to park another one.

On the right type the new subdomain. I mean, select "myclient.com" and type myclient.mycompany.com on the right.

Update or save. Wait just a few seconds and try it!

But you must not create the subdomain anywhere else.


The other way is just create an "A" entry on DNS of mycompany.com like this: myclient A "IP where myclient.com is". But it just works if you have an IP to myclient.com and no sharing! (shared ip doesn't work doing this...)