Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Subdomain of hostname after account creation

Discussion in 'cPanel Developers' started by Gastón, Jun 14, 2017.

  1. Gastón

    Gastón Member

    Joined:
    May 5, 2016
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Argentina
    cPanel Access Level:
    DataCenter Provider
    Hello,

    I want to add by default for all new accounts an apache Virtualhost Alias $username.$hostname pointing to all new accounts in order for the clients to have access to their site even when their domain it's not pointed to the server.

    Thank you for your help
    Regards.
     
    #1 Gastón, Jun 14, 2017
    Last edited by a moderator: Jun 14, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I moved this question to it's own thread.

    You could develop a script that creates a parked domain (domain alias) for an account and then setup a post Create::Account hook that automatically runs the script after an account is created. Here are some documents that will help you get started if you choose to go with this method:

    cPanel API 2 Functions - Park::park - Software Development Kit - cPanel Documentation
    Guide to Standardized Hooks - Whostmgr Functions - Software Development Kit - cPanel Documentation

    You'd also need to enable the "Allow users to park subdomains of the server’s hostname" option under the "Domains" tab in "WHM >> Tweak Settings".

    Thank you.
     
Loading...

Share This Page