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!

Php script to write .htacces file

Discussion in 'General Discussion' started by Thembinkosi, Jun 22, 2016.

  1. Thembinkosi

    Thembinkosi Member

    Joined:
    May 9, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    South Africa
    cPanel Access Level:
    Root Administrator
    I want to write to the .htaccess file of my clients using a php script . I have been searching for hints i do not know if its possible or not .

    i have written a script to create subdomain for my clients and the script gets access via root
    here is the code:

    $xmlapi = new xmlapi('x.x.x.x');
    $xmlapi->password_auth('root', 'password');
    $xmlapi->set_debug(1);

    // create sub domain
    $xmlapi->api1_query($username, 'SubDomain', 'addsubdomain', array($subDomain, $domaindomain, 0, 0, '/public_html/subdomain.domain'));

    maybe something similar to this could work :)?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,886
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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