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.

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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,275
    Likes Received:
    1,201
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page