Create a custom temporary URL on account creation
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.
-
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. 0 -
Hello, You could develop a script that utilizes our API to create an alias and then configure it to run automatically after account creation through a hook. The following documents are a good place to start: cPanel API 2 Functions - Park::park - Software Development Kit - cPanel Documentation 0 -
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. 0 -
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. 0
Please sign in to leave a comment.
Comments
4 comments