Temporary subdomain assignment for cPanel users
Hello,
We would like to automatically assign a temporary subdomain to each customer, tied to their cPanel username. For example, if the cPanel username is user1, the subdomain would be user1.example.com.
The temporary subdomain could either function as a mirror URL of his main domain name or be directly added to each cPanel account after account creation. Our goal is to have this subdomain automatically created whenever a new hosting account is set up.
For example:
A customer purchases hosting.
Their cPanel account is created with their main domain.
We want a separate subdomain, such as user1.example.com (not related to his main domain), to be automatically added to their cPanel account, and for it to work properly.
Could you please let us know the best approach for implementing this? If there are any other methods to provide a temporary domain/subdomain to our customers, we would appreciate your suggestions.
-
Hey there! We *just* released a Temporary Domain feature that you can find out more about here:
https://docs.cpanel.net/whm/account-functions/create-a-new-account/#domain-information
and here
https://docs.cpanel.net/whm/account-functions/create-a-new-account/#temporary-domains
However, right now there isn't a way to modify the temporary domains, but we're collecting feedback on that through our features site here:
https://features.cpanel.net/c/309-custom-temporary-domain
Before I recommend anything I just want to confirm that user1.example.com is *completely* separate from the user's maindomain.com, correct? Even the TLD portion of "example.com" is unique, possibly using your server's hostname?
0 -
Hello,
We do not want to use our server's hostname.
We have a separate domain, for example "gabena.net" which is added to a separate cPanel account.
I want to add subdomains like "maindomain.gabena.net" or "cPanelusername.gabena.net" automatically to every new cPanel account after creation.
I even tried to configure it via bash script with WHM hooks, but it shows "(XID pempbx) The domain “gabena.net” does not belong to “newcPanelusername”." even though I enabled remote domains and allow subdomains creating in Tweak Settings.
Is this possible to configure?0 -
I was also going to recommend a hook - since it's the same domain each time it should be something you can program.
While you enabled "Allow Remote Domains" did you also enable "Allow cPanel users to create subdomains across accounts" and "Allow unregistered domains" ?
0 -
Hello,
I enabled every possible option in Tweak Settings, but still receive the error that the domain doesn't belong to the cPanel user. It seems API can't see those Tweak Settings options.
Is there any other way to share access to that domain with other cPanel users?
0 -
Let's close this thread and stay in the one with the code snippet and log details.
0
Please sign in to leave a comment.
Comments
5 comments