Forum Moderators: phranque

Message Too Old, No Replies

referencing environment variables in mod_rewrite directives

         

Wolli

5:29 pm on Oct 7, 2018 (gmt 0)

5+ Year Member



Hi,
in rewrite-rules I can adress $_SERVER-Variables by %{'VARNAME'}.
How can I adress $_ENV-variables?

lucy24

9:54 pm on Oct 7, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



They do hide it in the docs, don’t they? It’s
%{ENV:variable}
where “variable” is, as you would expect, the name of the variable.

:: quick detour to make sure 2.2 and 2.4 are the same ::

phranque

8:03 pm on Oct 8, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



this is documented here:
https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond