Questo è la parte che permette di modificare manualmente il file
.htaccess:
Codice PHP:
<?php $file = ".htaccess"; // Posizione del file .htaccess
if(empty($_POST['testo'])){ ?>
<center><form action="htaccess.php" method="post">
<textarea name="testo" style="height:365px; width:615px"><?php echo file_get_contents("$file"); ?></textarea><br />
<input type="submit" value="Salva .htaccess" />
</form></center>
<?php }else{
$a = fopen($file,"w");
fwrite($a,"{$_POST['testo']}");
fclose($a);
?><br />
File <strong>.htaccess</strong> aggiornato con successo @ <?php echo date("d/m/Y H:i:s"); ?><hr style="width:100%" />
<center><form action="htaccess.php" method="post">
<textarea name="testo" style="height:365px; width:615px"><?php echo file_get_contents("$file"); ?></textarea><br />
<input type="submit" value="Salva .htaccess" />
</form></center>
<?php } ?>
Mentre per la parte automatizzata...beh...dipende da te e da varie cose...lo script deve essere un po' più complesso perchè PHP deve "capire" cosa modificare e cosa no...quindi la parte automatica penso che devi creartela tu o minimo darci maggiori informazioni su cosa dovrebbe fare PHP di preciso...cosa modificare/aggiungere/rimuovere e quando farlo...