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