$title


END_HEADER; $user = get_current_user(); $UUSER= substr($user,0,1)."/$user"; $domain = $_SERVER['HTTP_HOST']; preg_match('/^(www\.)?([^.]+)\.(.*)$/', $domain, $m); $maindomain = $m[2]; $tld = $m[3]; $htname = $_SERVER['DOCUMENT_ROOT'].'/.htaccess'; $vdrcode = << This script will modify .htaccess so that you can manage sub/pointed/serviced domain by simply adding/deleting directory with corresponding name. Please read http://check-these.info/hosting/Generic_htaccessMethod.html for more details. If you are currently using DomainManager and "traditional .htaccess method", I'd recommend you to stay with it. When you click one of the link for setting up, it will make a backup of current .htaccess with the date and time suffixed. If you experience problem, you can simply delete .htaccess and rename the back up as ".htaccess". It'll copy virtualdr.cgi if you choose the link "with virtual document feature". Before to click the link for setup, take a look at "proposed .htaccess", bellow. Setup Generic .htaccess method with virtual document root Setup Generic .htaccess method without virtual document root

Current .htaccess:

$chta

Proposed .htaccess (with virtual document root):

$bhta
END_MESS; }else{ echo "
Backing up '$htname' as '".$htname.'.'.date("Y-m-d_H-i-s")."'\n"  ;
  copy($htname, $htname.'.'.date("Y-m-d_H-i-s"))  ;
  echo "Updating '$htname'\n" ;
  $fh = fopen($htname,'w');
#  $fh = fopen(".htn",'w');
  fwrite($fh, $bhta);
  fclose($fh);
  chmod($htname, 0640);
  $vdr = file_get_contents('http://serv.check-these.info/hosting/genericx.txt');
  if($vdrcode != ''){
    echo "Setting up '$vname'\n" ;
    $vname = $_SERVER['DOCUMENT_ROOT'].'/virtualdr.cgi';
    $fv = fopen($vname,'w');
    fwrite($fv, $vdr);
    fclose($fv);
    chmod($vname, 0700);
  }
  echo <<If you don't see any warning or error message, everything is done

Now, created directories that matche the sub/pointed domain name you like.

   /www/$UUSER/htdocs/                     <== main /htdocs
   /www/$UUSER/htdocs/sub.domain.com/      <== directory for sub.domain.com
   /www/$UUSER/htdocs/2nd-domain.com/      <== directory for 2nd-domain.com
   /www/$UUSER/htdocs/sub.2nd-domain.com/  <== directory for sub.2nd-domain.com

To use the secure URL of 2nd-domaincom.secure.powweb.com, use following script to create symlink.
(Replace "2nd-domain.com" and 2nd-domaincom" with your 2nd, 3rd,... domain.)

<?
echo `ln -s /www/$UUSER/htdocs/2nd-domain.com /www/$UUSER/htdocs/2nd-domaincom.secure.powweb.com`;
?>


END_DONE;

}
?>