Assign another subdomains to the user

One of my user already has selected a domain when joining our Dooo account (i.e., profX.su.domains). He is aware that he can have many sub-domains based on the profX.su.domains. However, he would like to have a second sub-domain under su.domains.

I thought I can do this by login to WHM as root, locate the user from the List Accounts, and Click on cPanel, Go to Add-On Domain to add the XXX.su.domains for the user. However, i got the message
“su.domains” is already owned by another user.

There must be a different way to do this and I went to a wrong path.

Thanks,
Toai

Hi Toai,
Great question! You’re absolutely in the right place for something like this, I was able to replicate the error on my end. I did notice that the main “su.domain” domain was added to the main domains.stanford.edu account as an alias domain. I wonder if that’s what the conflict is.

Let me take a look a little deeper and I’ll follow up with a solution. If you have any follow-ups feel free to add them here and I’ll take a look!

Thanks you!
Just FYI - event if it failed with the error, but I still see the folder name of the subdomain got created. May be this is because the script created the folder first, but then failed and there is no clean up process after it failed to create the sub-domain (or the script should validate first, then create the folder).

Toai,
It turns out you’ll want to turn the setting on to allow cPanel users to add subdomains across accounts rather than WHM users. I still recommend you turn this on in a case by case basis, but that should allow you to add the subdomain properly as an addon domain in the same cPanel account.

This is under Tweak Settings under ‘Domains’ and ‘Allow cPanel users to create subdomains across accounts.’

As for the folder creation/removal, the script looks for any DNS entries and settings that allow users to add the subdomain first, then at folder creation. If the folder does not exist, it creates it and skips creation if it exists previously. When the addon/subdomain is removed the file stays in place to preserve any content/settings that were created in case that affects other domains/URLs on the account.

Let me know if you have any other questions!

Thank you, Meredith!

It works as you mentioned. Basically, I spawn two different browsers.
One browser in the user’s panel Add-On domain with all of the information ready to hit the submit button. On another browser turn on the "Allow cPanel Users feature’ screen and clicked Save.
Switch to the user cPanel hitting the submit button.
I then turn off the Allow cPanel users to create subdomains across account feature.
All in less than 10sec.

This topic was automatically closed after 365 days. New replies are no longer allowed.