Re: [users@httpd] Re: Re: setting prefer-language as part of a rewritecond

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

 



On 4/14/05, Per Jessen <per@xxxxxxxxxxxx> wrote:
> SetEnvIf Request_URI ^/([a-z][a-z])/  prefer-language=$1
> SetEnvIf Remote_Addr ^(.+)$           spamtrap=$1
> 
> Given a URL like:  /xx/langtest, I would expect to have two environment variables:
> 
> spamtrap=<ip-address>
> 
> and
> 
> prefer-language=xx
> 
> What I have (according to a phpinfo() printout) is only the 'spamtrap' variable.  There is
> another set of variables all prefixed with 'REDIRECT_', including 'REDIRECT_prefer-language",
> but I suspect this is php-specific?
> 
> So, why do I get my 'spamtrap' variable set properly, but not 'prefer-language' ????  I'm
> beginning to consider a bug-report.

Not a bug.  The REDIRECT_ variables indicate that the request went
through an internal-redirect (apache did a subrequest to grab the
final document).  All the variables from before the redirect are
prepended with the REDIRECT_ thing.  spamtrap obviously gets set again
on the redirect, so it should have both a REDIRECT_ and a
non-REDIRECT_ variable.

This may also be why the RewriteRule didn't work.

Now, the question is how to avoid the internal redirect.  Again I'm
just guessing here, but I suspect that you could do this either by
replacing your RewriteRule with an Alias, or by using a full
file-system path in the target of your RewriteRule.

Joshua.

---------------------------------------------------------------------
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