سؤال

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? :/

هل كانت مفيدة؟

المحلول

If your cPanel main domain is mycompany.com just create an addon domain myclient.com

Create myclient.com
Automatically a subdomain myclient.mycompany.com that points to the webroot of myclient.com is created.
Just check it on Subdomains page.


enter image description here

If your cpanel main domain is something else, go to the Addon Domains page and create myclient.com. Note the Document Root automatically generated (most probably /public_html/myclient.com) here or type your own Document Root and copy it.

and then create a subdomain myclient.mycompany.com by pasting myclient.com's Document Root in the Document Root field.

myclient.com will be accessible through myclient.mycompany.com

Hope that helps...

Peace be upon you...

نصائح أخرى

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...)

For PLESK:

  1. add a new file named: vhost.conf in subdomain's conf folder with just one line: DocumentRoot [your new path]

Your new path may be: - for new domain root: /var/www/vhosts/(new domain)/httpdocs/ - for new domain subdomain: /var/www/vhosts/(new domain)/subdomains/(subdomain)/httpdocs/

  1. execute as root /usr/local/psa/admin/bin/websrvmng -a
  2. restart apache from plesk or execute: service httpd restart
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top