Re: mod_rewrite E flag does not set env. variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 10, 2008 at 1:12 PM, Thorsten Scherler
<thorsten.scherler.ext@xxxxxxxxxxxxxxxxxxx> wrote:
> On Mon, 2008-03-10 at 11:20 +0100, Krist van Besien wrote:
>  > On Mon, Mar 10, 2008 at 9:58 AM, Thorsten Scherler
>  > <thorsten.scherler.ext@xxxxxxxxxxxxxxxxxxx> wrote:
>  > > Hi all,
>  > >
>  > >  I am trying to use the E flag in some of my rewrite rules but without
>  > >  suggest.
>  > >
>  > >  I have following configuration:
>  > >  RewriteMap portadaboja txt:/opt/datos/httpd/redirect.txt
>  > >  RewriteRule "^/BOJA$"
>  > >  "http://%{HTTP_HOST}/boja/${portadaboja:boletin}"; [E=FOCUS:true,R]
>  > >
>  > >  The redirect works fine but when I use in my ssi the following:
>  > >  <!--#set var="focus" value="$FOCUS" -->
>  > >  1. <!--#echo var="focus" -->
>  > >  2. <!--#echo var="FOCUS" -->
>  > >  3. <!--#echo var="%{ENV:FOCUS}" -->
>  > >
>  > >  The out put is:
>  > >  1. 2. 3. (none)
>  > >
>  > >  I am using apache2 as package from Ubuntu (2.2.3-3.2ubuntu2.1).
>  > >
>  > >  Can somebody explain me what I am doing wrong?
>  >
>  > You are doing a redirect. Which means that after the rule matches the
>  > client gets a response and starts a _new_ request. The apache  process
>  > handling this new request does not have access to environment
>  > variables set in a previous request.
>  >
>  > Krist
>
>  Thanks very much Krist for this explanation. So I need to find a
>  workaround.

You could try not doing a redirect, as it looks like you are
redirecting to the same host. This is often not needed.
eg:

RewriteRule ^/BOJA$"       /boja/${portadaboja:boletin}" [E=FOCUS:true]

Processing will thus continue within the same request.

Krist


-- 
krist.vanbesien@xxxxxxxxx
krist@xxxxxxxxxxxxx
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux