In my .htaccess file, I use variables (SetEnv) to toggle ON/OFF the website when I do updates, is it safe or is it even possible to modify that .htaccess file via a PHP script ?
To be more specific, I need to comment/un-comment those lines:
#RewriteCond %{REMOTE_ADDR} !LOCALIPHERE
#RewriteCond %{REQUEST_URI} !^/Site/maintenance.htm
#RewriteCond %{REQUEST_URI} !^/Site/styles/style.css
#RewriteCond %{REQUEST_URI} !^/Site/includes/jquery-1.4.4.min.js
#RewriteCond %{REQUEST_URI} !\.(jpg|jpeg|png|gif|swf)$
#RewriteRule ^.* /Site/maintenance.htm [L]
Thank you
Edit:
My definition of safe is: I would like to know how the site will behave if the .htaccess file is opened by a PHP script and the website is being visited in the same time.
If the file is writable by the PHP process it can be modified like every other file.
However, instead of commenting/uncommenting your code you should use a
RewriteCondchecking your env var.