$file = 'my/path/to/htaccess/location/.htaccess';
$htaccess = file($file);
$ht = fopen($htaccess,'a');
fwrite($ht,"deny");
fclose($ht);
Я пытаюсь изменить файл .htaccess через functions.php, CHMOD установлен на 777, есть идеи?
Редактировать:
Только что включены ошибки:
Warning: file() [function.file]: URL file-access is disabled in the server configuration in /home/tfbox/domains/ibrogram.com/public_html/themes/beta/wp-content/themes/beta/functions.php on line 133
Warning: file(http://themes.ibrogra.com/beta/.htaccess) [function.file]: failed to open stream: no suitable wrapper could be found in /home/tfbox/domains/ibrogram.com/public_html/themes/beta/wp-content/themes/beta/functions.php on line 133
Warning: fopen() [function.fopen]: Filename cannot be empty in /home/tfbox/domains/ibrogram.com/public_html/themes/beta/wp-content/themes/beta/functions.php on line 135
Warning: fwrite(): supplied argument is not a valid stream resource in /home/tfbox/domains/ibrogram.com/public_html/themes/beta/wp-content/themes/beta/functions.php on line 137
Warning: fclose(): supplied argument is not a valid stream resource in /home/tfbox/domains/ibrogram.com/public_html/themes/beta/wp-content/themes/beta/functions.php on line 139