: To add to covener's analysis: You can use environment variables when using rewrites, but as you mention, SetEnv doesn't retain that info (to my knowledge). I've had good success using forced
To add to covener's analysis:
You can use environment variables when using rewrites, but as you mention, SetEnv doesn't retain that info (to my knowledge). I've had good success using forced variable injections in my start up scripts. For example, when calling the apachectl or httpd binaries, you can do something like:
In your shell script do (i use in case syntax, and add an option for startMaint):
MAINTENANCE=TRUE ${APACHE_ROOT}/bin/apachectl -d ${APACHE_ROOT} -f ${APACHE_CONF} -k start
RewriteCond %{ENV:MAINTENANCE} ^TRUE$
RewriteCond %{REQUEST_FILENAME} !.(gif|jpg|png|ico)$ [NC]
RewriteCond %{REQUEST_URI} ^/(status|uri1|uri2|uri3|etc).*$ [NC]
RewriteCond %{REQUEST_URI} !^/static/siteMaintenance.html$ [NC]
RewriteRule .* /static/siteMaintenance.html${pages:%1:NULL}? [R=302,L]
More posts by @Ravi8258870
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.