You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Porter, Mark" <Ma...@LibertyMutual.com> on 2004/03/19 04:12:44 UTC

[users@httpd] RewriteRule with E= option

I'm trying to use the following rewrite rule to pass an environment
variable into a cgi:

RewriteRule / http://myserver.domain.com/cgi-bin/printenv
[R,E=ENVAR:foo]

I expect to see an environment variable in the printenv output called
ENVAR, with a value of foo, but it's not showing up. Can anyone tell me
what I missed?

Thanks!




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


Re: [users@httpd] RewriteRule with E= option

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 18 Mar 2004, Porter, Mark wrote:

> I'm trying to use the following rewrite rule to pass an environment
> variable into a cgi:
>
> RewriteRule / http://myserver.domain.com/cgi-bin/printenv
> [R,E=ENVAR:foo]
>
> I expect to see an environment variable in the printenv output called
> ENVAR, with a value of foo, but it's not showing up. Can anyone tell me
> what I missed?

You are using "R" for "Redirect".  Environment variables cannot be passed
through external redirects.  If you used
RewriteRule / /cgi-bin/printenv [E=ENVAR:foo]
you might have better luck.

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