You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Sergey Trofimov <st...@oxxomedia.com> on 2000/12/09 08:48:58 UTC
mod_rewrite questions
Hiya people.
I'm just trying to configure mod_rewrite for access checking purposes
and having some troubles with it. Hope that maybe you can help me 8-)
I want to use mapping to external program written in perl. I.e. I have
following commands in my config:
RewriteEngine on
RewriteMap check-map prg:/usr/lib/map.pl
RewriteCond %{QUERY_STRING} ^.*session=(.+)
RewriteRule ^(.*\.cgi) $1?${check-map:%1}= [L,R]
First question:
My program receive key value exactly as '%1' without expansion to
value of %1. I was playing around this without success. What do I do
wrong?
Second question:
On listings at http://www.heise.de/ix/artikel/E/9612149/listings.shtml
I saw such code as
#!/usr/bin/perl
$| = 1;
while (<>) {
if ($ENV{'HTTP_USER_AGENT'} =~ m|Mozilla/.*|) {
s|^foo/|bar/|;
}
print $_;
}
but in my mapping program Apache's server variables are not defined.
How this can be done (this could help me in case of unsolved first
question)?
Thanks in advance.
--
Best wishes,
Sergey.
Re: mod_rewrite questions
Posted by Tony Finch <do...@dotat.at>.
Sergey Trofimov <st...@oxxomedia.com> wrote:
>
>I'm just trying to configure mod_rewrite for access checking purposes
>and having some troubles with it. Hope that maybe you can help me 8-)
http://httpd.apache.org/dist/apache_1.3.14-fix.diff
Tony.
--
f.a.n.finch fanf@covalent.net dot@dotat.at
"Dead! And yet there he stands!"