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.

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:
    1
    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:
    14,466
    Likes Received:
    196
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. tlsoft

    tlsoft Registered

    Joined:
    Sep 11, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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 cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    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
     
Loading...

Share This Page