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!

Custom file adding on subdomain creation

Discussion in 'cPanel Developers' started by tlsoft, Sep 11, 2011.

  1. tlsoft

    tlsoft Registered

    Joined:
    Sep 11, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    51
    cPanel Access Level:
    Root Administrator
    Greetings,

    We do a lot's of develpoment, and now i like to ask, is it possible in Cpanel, when we create a subdomain, then the cpanel place an custom htaccess and index.php file in the subdomain's directory?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,478
    Likes Received:
    421
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. tlsoft

    tlsoft Registered

    Joined:
    Sep 11, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    51
    cPanel Access Level:
    Root Administrator
    This would be an great idea, i wrote an post, hope the guys will do the best.
     
  4. MattDees

    MattDees Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    416
    Likes Received:
    1
    Trophy Points:
    243
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Actually this is possible, we have the function hooks system which allows you to hook into API1 and API2 calls for cPanel. From here you can create a hook for SubDomain::addsubdomain that will be passed the document root.

    Note: this will be executed after the subdomain has been added, and run as root, so you'll need to change perms on any file you may copy into the docroot.

    Check out:

    Function Hooks
    and
    ApiSubDomain < ApiDocs/Api2 < TWiki
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice