In an Apache server, I need to disable keepalive if a specific URL is matched.
To do so, I used mod_rewrite to set it then let the script run its course.
RewriteCond %{REQUEST_URI} ^/specific_url
RewriteRule ^ - [E=nokeepalive]
.......
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
Now my problem is that nokeepalive
end up being prefixed/renamed to with REDIRECT_ if it matches
From this question : When setting environment variables in Apache RewriteRule directives, what causes the variable name to be prefixed with "REDIRECT_"?
I assumed it was due to the RewriteRule
But it is not prefixed if I remove the RewriteCond (which would disable keepAlive
globaly with any URL)
Is there a way to prevent this prefixing with RewriteCond ?
I cannot use SetEnvIf
since I use mod_rewrite
so I must use RewriteRule
.
SetEnv/SetEnviF also won't work as they can not read from variable that were not assigned using SetEnv/SetEnvif. I tried with SetEnvIf to define only if REDIRECT_nokeepalive exist ( since nokeepalive just have to be defined, regardless of the value ) - but to no avail.