httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] Comparing environmental variables in httpd.conf for conditional logic
Date Mon, 21 May 2007 15:51:35 GMT
On 5/21/07, Neil A. Hillard <neil.hillard@agustawestland.com> 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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message