SOLVED How to convert cpanel accounts to addon domains function

Clixer

Active Member
Feb 24, 2018
41
2
8
Australia
cPanel Access Level
Root Administrator
Hello folks,

Would like to convert some of the cpanel accounts to addon domain function of a single cpanel account. Is there an automated process for this?

Thanks in advance.
 

quietFinn

Well-Known Member
Feb 4, 2006
1,668
341
438
Finland
cPanel Access Level
Root Administrator
Hello folks,

Would like to convert some of the cpanel accounts to addon domain function of a single cpanel account. Is there an automated process for this?

Thanks in advance.
There is no tool to do that.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,274
1,291
313
Houston
There is currently no tool to convert an account to an addon domain. To facilitate this you'd need to do it manually, the documentation on manual migrations would be useful to understand which files should be moved How to Manually Migrate Accounts to cPanel from Unsupported Control Panels - cPanel Knowledge Base - cPanel Documentation


As far as the request for the tool goes, I recommend opening a feature request [https://go.cpanel.net/features].

Please use the following format when creating the request to ensure your idea gets as much visibility as possible and translates into actionable work:

==============

As a {cPanel User, System Administrator, web-hosting provider, or any other user perspective}, I would like {the feature that is being requested} so that {benefit that the request adds to the product}.

==============

Feel free to respond here with a link to the feature request upon approval.

Thank you.
 

Clixer

Active Member
Feb 24, 2018
41
2
8
Australia
cPanel Access Level
Root Administrator
Hi @cPanelLauren,

Thank you for your guidance.

I referred to this page How to Manually Migrate Accounts to cPanel from Unsupported Control Panels - cPanel Knowledge Base - cPanel Documentation, and having some issues, hopefully you could clarify some of these issues.

Firstly, lets assume that the cpanel account owner is domainA and the domain we will add is domainB.

After adding the domainB when I load domainB in the browser, in the address bar, it shows the web address as https://www.domianA/domainB/. This redirection is incorrect, how do I fix this issue?

In the file manager, the path to public_html folder of domainB is /home/username/public_html/domainB.

In the path above where exactly, I would copy the files related to folders mail, tmp, etc and SSL for domainB?

Many thanks for your help.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,274
1,291
313
Houston
After adding the domainB when I load domainB in the browser, in the address bar, it shows the web address as https://www.domianA/domainB/. This redirection is incorrect, how do I fix this issue?
When you go to cPanel>>Domains>>Addon Domains what is set for redirection and the document root?

In the path above where exactly, I would copy the files related to folders mail, tmp, etc and SSL for domainB?
All mail regardless of the domain is stored in /home/$user/mail/ - the domain.tld mail folder would go in this directory

All of the shadow and passwd files are what need to be moved from /home/$user/etc/domain.tld into the corresponding directory at /home/$user/etc/domain.tld
 

Clixer

Active Member
Feb 24, 2018
41
2
8
Australia
cPanel Access Level
Root Administrator
When you go to cPanel>>Domains>>Addon Domains what is set for redirection and the document root?
Hi @cPanelLauren. Here is the info you asked for:

Document root: /public_html/domainB.com
Redirects to: Not redirected

I suppose a redirection needs to bet set, not sure what it should be, waiting to hear from you.

I understood your answers about copying of other files.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,274
1,291
313
Houston
Actually, no it shouldn't need to be redirected at all. The addon domain being in that specific folder should be fine and should not cause it to come up at https://domaina.com/domainb/

This is also how I have my test domain configured (this won't resolve anywhere but locally)
addondomain.png

Is there any redirection set for the primary domain? You can see this in cPanel>>Domains>>Redirects as well as /home/$user/public_html/.htaccess
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,274
1,291
313
Houston
The redirect in the .htaccess file redirect users from their original location to the same location but using HTTPS:

RewriteRule ^(.*)$ https://www.domaina.com/$1 [R=301,L]
Is that all there is the redirect? you noted that the site goes to https://domainA/domainb - namely that it reroutes you to https. If you comment out the entire rewrite section in the .htaccess and attempt to view domainb in a browser with its cache cleared do you still get redirected?
 

Clixer

Active Member
Feb 24, 2018
41
2
8
Australia
cPanel Access Level
Root Administrator
Is that all there is the redirect? you noted that the site goes to https://domainA/domainb - namely that it reroutes you to https. If you comment out the entire rewrite section in the .htaccess and attempt to view domainb in a browser with its cache cleared do you still get redirected?
Hi @cPanelLauren. I acted as per your suggestion and the issue is resolved.

Many thanks for your help.

is it possible to achieve both outcomes were for both domains https is forced without breaking the redirects.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,274
1,291
313
Houston
Hi @cPanelLauren. I acted as per your suggestion and the issue is resolved.

Many thanks for your help.

is it possible to achieve both outcomes were for both domains https is forced without breaking the redirects.
I'm glad to hear that was the issue and it's resolved now. It is possible to do this but you'd need to only redirect the primary domain to https. What you were doing prior was redirected everything to the primary domain and https.

There is a feature in cPanel>>Domains>>Domains which will you can switch on "Force HTTPS" which adds a rewrite to https in the apache configuration for that specific VirtualHost.
 

Clixer

Active Member
Feb 24, 2018
41
2
8
Australia
cPanel Access Level
Root Administrator
I'm glad to hear that was the issue and it's resolved now. It is possible to do this but you'd need to only redirect the primary domain to https. What you were doing prior was redirected everything to the primary domain and https.

There is a feature in cPanel>>Domains>>Domains which will you can switch on "Force HTTPS" which adds a rewrite to https in the apache configuration for that specific VirtualHost.
Hi @cPanelLauren. Many thanks for your help. All is good now.
 
  • Like
Reactions: cPanelLauren