Re: Comparing environmental variables in httpd.conf for conditional logic

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

 



On 5/21/07, Neil A. Hillard <neil.hillard@xxxxxxxxxxxxxxxxxx> wrote:
Hi,

Joshua Slive wrote:

> In any case, this isn't going to work. The regular expression used in
> RewriteCond (and RewriteRule and SetEnvIf) cannot contain variables.
> It is compiled at server-start and doesn't have access to anything
> per-request.
>
> I don't think there is any way to do exactly what you want with
> standard modules. You'll need to specify the ServerName explicitly in
> the rules.

I don't believe that's true.  I have the following rewrite to remove a
prefix from the REMOTE_USER variable:

RewriteCond        %{LA-U:REMOTE_USER} ^EXT_(.*)$
RewriteRule        .* - [env=RU:%1]

and:

RewriteRule ^/$ http://%{SERVER_NAME}/site/ [R]


I haven't got a spare server to play around with at the moment, but I'm
sure something is possible.  Is it just a case of it doesn't like the
environment variable on the RHS argument?

As someone else asked, have you enabled the RewriteLog?

The regular expression part can't have a variable. In the RewriteCond
case, the regular expression is on the right, while in the RewriteRule
case it is on the left.

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