Multiple values RewriteMap prg

2019-09-03 15:47发布

问题:

I'm not able to pass multiple values through a RewriteMap prg. This is what I have:

RewriteMap encrypt "prg:/bin/python2.7 /var/www/encrypt.py"
RewriteRule /secure ${encrypt:%{LA-U:ENV:email}} [P]

I am able to pass just one variable from the header, but not more than two.Any help would be appreciated it.

Thank you!

回答1:

RewriteMap only takes one key string as a parameter, but you can append multiple things to the key. This is what I ended up with:

RewriteRule /secure http://website.com/${encrypt:%{LA-U:ENV:uid};%{LA-U:ENV:givenname};%{LA-U:ENV:surname};%{LA-U:ENV:email}}

The semicolon act as a separator to be used later to split the string.