mod_rewrite carry over all environment variables

This is a discussion on mod_rewrite carry over all environment variables within the Linux Web Servers forums, part of the Web Server and Related Forums category; I am doing a simple Apache mod_rewrite which rewrites a simple URL to a more complex script URL. I am ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-22-2003
Scott Lopatin
 
Posts: n/a
Default mod_rewrite carry over all environment variables

I am doing a simple Apache mod_rewrite which rewrites a simple URL to a
more complex script URL. I am also tracking the usage and trying to
record the IP information of the request.

The mod_rewrite rules I have are not keep the original environment
variables including IP address and browser information.

Does anyone know how I can keep the original environment variables and
forward them to the new rewritten URL?

Thanks,
Scott
  #2 (permalink)  
Old 10-27-2003
Joachim Ring
 
Posts: n/a
Default Re: mod_rewrite carry over all environment variables

> I am doing a simple Apache mod_rewrite which rewrites a simple URL to a
> more complex script URL. I am also tracking the usage and trying to
> record the IP information of the request.
>
> The mod_rewrite rules I have are not keep the original environment
> variables including IP address and browser information.
>
> Does anyone know how I can keep the original environment variables and
> forward them to the new rewritten URL?


while i have some difficulties understanding how plain rewrite-rules
(ie those without external redirects or reverse proxying) should fail
to keep HTTP_USER_AGENT or REMOTE_ADDR env variables, one could take
the sledgehammer approach of tagging on those values to the request in
custom http headers:

RequestHeader set X-My-User-Agent %{HTTP_USER_AGENT}e
RequestHeader set X-My-Client-IP %{REMOTE_ADDR}e

due to absence of a possibility to manipulate request headers and set
dynamic header values in apache 1.3 this will work under apache2 only,
though.

btw, one can set the environment variable used as header value in a
rewrite rule before, which allows for some really nifty tricks...

joachim
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:50 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0