Use PHP to Dynamically Add To .htaccess File Admin June 20, 2016 $f = fopen(".htaccess", "a+"); fwrite($f, "your content"); fclose($f);123$f = fopen(".htaccess", "a+");fwrite($f, "your content");fclose($f);