1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Apache 2 mod_rewrite: SetEnv and RewriteCond

Discussion in 'Apache' started by purba, Jul 20, 2006.

  1. #1
    Hi!

    I'm trying to set Environment variable as a condition to Rewrite.

    If we use Rewrite's "native" variable like %{REMOTE_HOST}, everything works perfect, but when we try to use ENV variable:

    SetEnv VAR1 v1value
    RewriteCond %{ENV:VAR1} ^1$
    RewriteRule ^(.*)$  http://192.168.0.183/$1  
    Code (markup):
    In rewrite log appears the following mesage:

    RewriteCond: input='' pattern='^1$' => not-matched
    Code (markup):
    this means that RewriteCond does not actually "see" this variable.


    If we use SetEnvIf instead of SetEnv, it works OK.

    Any ideas of What the problem can be?
     
    purba, Jul 20, 2006 IP