httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A. K." <>
Subject Re: [users@httpd] mod_rewrite: remembering environment variables
Date Thu, 30 Nov 2006 17:37:49 GMT
iptables redirects to the VirtualHost which rewrites to the script housed on
localhost. The script does some processing then "re-requests" the original
request based on the parameters and query string passed to it. will display just fine except for the logo image which gets
re-written to

If I add a third rule, "RewriteRule (.*)$1 [P]", the
image is fetched appropriately. The question is how do I dynamically
determine what the appropriate HTTP_HOST should be?

Is my approach "fixable"? Or should I be attacking this differently?

Listen *:10000
<VirtualHost *:10000>
    RewriteEngine on
    RewriteCond %{SERVER_NAME}          !^10\.0\.255\.1$
    RewriteRule (.*)                                 "{SERVER_NAME}%{REQUEST_URI}&"
    RewriteCond %{REQUEST_URI}            !script\.pl
    RewriteRule ^/cgi-bin/(.*)$         "http://$1?" [P]
ProxyRequests On
<Proxy *>
 Order deny,allow
 Deny from all
 Allow from

On 11/30/06, Joshua Slive <> wrote:
> On 11/30/06, A. K. <> wrote:
> > The mod_rewrite doc mentions that the E=VAR:VAL flag "[can be used] to
> strip
> > but remember information from URLs".
> >
> > What exactly does that mean?
> >
> > I need to "remember" the values of certain EV's after a rewrite process
> has
> > completed. It would be particluarly useful to me know what the original
> > HTTP_HOST was as requests come through for content referenced by
> relative
> > paths on the original host but the HTTP_HOST has already been rewritten.
> >
> > Could I use SetEnv to create an EV called ORIGINAL_HOST and then set it
> to
> > the value of HTTP_HOST prior to rewrites so that I can reference it
> during
> > subsequent rewrites?
> >
> > What would be the best method for accomplishing this? Or am I totally
> off
> > the mark regarding what SetEnv and E=VAR:VAL do?
> You need to provide some details on your configuration, because the
> answer changes depending on whether you are using internal rewriting
> (aliasing), external rewriting (redirecting) or proxying.
> Joshua.
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:> for more info.
> To unsubscribe, e-mail:
>    "   from the digest:
> For additional commands, e-mail:

View raw message