jigen7 Posted February 19, 2008 Share Posted February 19, 2008 hi everybody! is it possible to generate an .htacess file using a php script?? then save it to a directory?? Link to comment https://forums.phpfreaks.com/topic/91872-php-to-generate-htacess/ Share on other sites More sharing options...
tinker Posted February 19, 2008 Share Posted February 19, 2008 yes... I read mine line by line, having delimiting tags (an obvious line), in between these I change what I need. You could on the other hand use preg_replace. Link to comment https://forums.phpfreaks.com/topic/91872-php-to-generate-htacess/#findComment-470485 Share on other sites More sharing options...
Daniel0 Posted February 19, 2008 Share Posted February 19, 2008 It's just a plain text file. Nothing fancy about it. Link to comment https://forums.phpfreaks.com/topic/91872-php-to-generate-htacess/#findComment-470487 Share on other sites More sharing options...
jigen7 Posted February 19, 2008 Author Share Posted February 19, 2008 ???sorry could you eleborate more? Link to comment https://forums.phpfreaks.com/topic/91872-php-to-generate-htacess/#findComment-470492 Share on other sites More sharing options...
Daniel0 Posted February 19, 2008 Share Posted February 19, 2008 It's a file in plain text which you can just open and put content in just like any other file. E.g. <?php $contents = <<<EOF Alias /hello /home/daniel/a_folder/hello2 EOF; file_put_contents('/var/www/.htaccess', $contents); ?> Link to comment https://forums.phpfreaks.com/topic/91872-php-to-generate-htacess/#findComment-470500 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.