Mobile app version of vmapp.org
Login or Join
Ravi8258870

: 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

@Ravi8258870

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]

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Ravi8258870

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme