Custom file adding on subdomain creation

tlsoft

Registered
Sep 11, 2011
3
0
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?
 

MattDees

Well-Known Member
Apr 29, 2005
416
1
243
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