You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by li...@gmail.com on 2007/12/23 01:52:22 UTC

[users@httpd] Add Enviroment paramenters with RewriteRule ?????

Hi, folks:

I have a problem with setting enviroment paramenters with
RewriteRule.. For example, in my document_root/.htaccess, I had:

RewriteEngine on
RewriteBase  /
RewriteRule ^([^/]+)/   -  [E=Location:$1]
RewriteRule ^dir/(.*)$  guestbook/dir.html?q=$1  [QSA,L,PT]

By line3, I want to add an enviroment parameter to some specific URLs, i.e.
If the URL is http://mysite.com/guest/book.html, it will get an
Enviromental parameter as:

  $ENV{Location} = 'guest';

but what I get is:      $ENV{Location} = 'bin';

It's probably that I am using Perl with FastCGI, the fcgi executable
is located in

    document_root/bin/handler.fcgi

this seems have explained the problem... but the RewriteRule at line-4
works properly, it doesnot add /bin in its path.. So what makes it
different if or not I use the [E=var:val] flag in the RewriteRule??

My system: Apache2.059, mod_fastcgi 2.4.2, Linux(2.6.18) Ubuntu box..

(should have an upstream Proxy server, since I got
HTTP_X_FORWARDED_FOR in my %ENV), only .htaccess available now.

Thanks in advance,

lihao(XC)

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