How to add an addon domain for a new website with unique domain, subdomain, alias/parked domains

1

Go to Domains section of your cPanel, you will see these icons to click depending on your need :

Domains management by cPanel


To create an addon domain or a subdomain, use icon Domains :
When creating an addon domain, click on 'Create a New Domain', type and validate. To create a subdomain, enter a new name followed by a period (.) and then the website’s domain. For example, enter subdomain.example.com to create a subdomain. You must choose if the domain will have its own files instead of public_html content. If not, untick option 'Share document root', give a name to this folder name, and press 'Submit'. This folder related to your new site will be located outside of public_html, and it is in this folder that you will have to put the files of the new website. You can add a domain whose sole purpose is to redirect to a domain other than the main one of your cPanel account, add domain and a redirect. 

- make sure you have updated with the DNS given when ordering your hosting plan and wait the necessary propagation time...
- if you do not use our DNS, find your IP in the Zone editor of your cPanel, then make an entry A in the DNS zone of your registrar, then create your domain/subdomain in your cPanel and wait the necessary propagation time...

Remarks :
1 - To update folder where files of your website is stored, you can do this at any time on an existing domain, go to addon domains, and click on modify 'Document Root', input the desired folder name. After, check/move files from the website from old folder to the new folder using the file manager of cPanel, do select and move with your mouse. Finally, delete the old empty folder

2 - If you make a change after you installed a SSL, you must first uninstall the SSL, move your site (step 1) and then reinstall SSL
3 - To add a domain or subdomain with special character or accent, you must convert it to ASCII before you can add it to cPanel :
https://www.verisign.com/en_US/channel-resources/domain-registry-products/idn/idn-conversion-tool/index.xhtml?loc=en_US

4 - cPanel has an imperfection when adding any domains, it creates a domain alias that is similar to a subdomain of your main cPanel account domain, so that depending on the CMS/website, your website (domain added) can also be accessible from this alias/subdomain ...
The solution to add this to your .htaccess file, replace the name of the subdomain and domain with the right values :

Rewritecond %{HTTP_HOST} ^subdomainaddon.maindomaincpanel.com$
Rewriterule ^(.*) http://www.youraddondomain.com/$1 [QSA,L,R=301]

Other remark :

  • When setting up a domain redirection to another, if you check the "Wild Card redirect" option, this will redirect all links from folders and pages from the old domain to the equivalent on the new domain
  • If you wish to send emails from a subdomain, you must replicate manually SPF value same as main domain related in 'Zone editor'