On 11.04.2013 12:10, Daniel Gruno wrote:
On 04/10/2013 11:21 PM, Guenter Knauf wrote:
- r:expr(string) sample uses %{HTTP_HOST}, but that doesnt work for me
This function does work perfectly, on Linux/FreeBSD at least ;)
it uses ap_expr, so whatever that function supports, this should as
well. What I tried on www.humbedooh.com was:
local match = r:expr("%{HTTP_HOST} =~ /^www/")
if match then
r:puts("expr matches")
else
r:puts("expr doesn't match")
end
and I got "expr matches" :)
ok, I admit that I didnt test exactly this sample; but the usage of
%{HTTP_HOST} there made me think that it will always be expanded, f.e. like:
r:puts("HTTP_HOST=%{HTTP_HOST}\n")
and this didnt work ...
Gün.