Create a custom temporary URL on account creation

Ian Svoboda

Member
Mar 19, 2017
5
1
3
Jacksonville, FL
cPanel Access Level
Root Administrator
I'm aware that cPanel includes a temporary URL that uses the server IP address (http://{$service_server_ip}/~{$service_username}/). I'm interested in setting up a temporary URL that uses a custom domain that I own instead.

Example:
{$service_username}.mydomain.com

If someone has any experience setting up something like this or can point me towards some resources I'd really appreciate it.
 

syslint

Well-Known Member
Verifed Vendor
Oct 9, 2006
271
7
168
India
cPanel Access Level
Root Administrator
Twitter
May be you can use the skelldirectory with a custom php script, that will redirect the newly created domain name to your landing domain name.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463

Ian Svoboda

Member
Mar 19, 2017
5
1
3
Jacksonville, FL
cPanel Access Level
Root Administrator
Hey cPanelMichael,

Thanks for your reply. I've been going through the documentation and I admit I'm still a little confused. I have a few specific questions that I"m hoping you can help me with:

1. If I want to write the hook in PHP, where should my action code file be placed?
2. What would be the best way to figure out the structure of data available to me in the hook? For instance, if I want to get the username of the account that was just created, how could I access that data?
3. Would it be best to mark the Park call via the LiveAPI, since I'm using PHP to write the hook?
4. In the hook example for PHP, I found, there are some echo commands early in the hook. What is the purpose of the echo here?


Thanks again for your help. Any additional information would be most appreciated.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hi @Ian Svoboda,

It's a good idea to first confirm the specific actions you'd like to have occur automatically at the time of account creation. Could you manually setup an Alias using the cPanel UI after the account is created and verify that's the only action that's required upon account creation? If so, let us know and we can proceed to provide you with more information, as it's likely a simple bash script is going to be easier to setup than a custom PHP script.

Thank you.