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?? Quote 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. Quote 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. Quote 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? Quote 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); ?> Quote Link to comment https://forums.phpfreaks.com/topic/91872-php-to-generate-htacess/#findComment-470500 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.