Hi,

I am trying to get a rewrite rule working that will take the value
from an HTTP header and use the value to create a new target
destination for the HTTP request.  An example of what I'm trying to do
follows:

Original HTTP request being sent to http://myhost.domain/ containing the header
MyRoutingID: SOME_VALUE

This needs to be rewritten and sent to http://myhost.domain/SOME_VALUE

This will then be forwarded using a reverse proxy to
http://apphost.domain/SomeLocation/SomeApplication

I know that this may seem like a really convoluted way of doing
things, but our clients don't actually know where they are sending
requests to, other than the server name.  The receiving server has to
pass the request along based on the routing ID; however, the routing
ID isn't actually part of the final destination URL.  The routing ID
-> destination URL mapping will be generated and included as an
external config file loaded into the Apache configuration at load.

So far what I have is the following:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

ProxyRequests Off
ProxyPass /SOME_VALUE http://apphost.domain/SomeLocation/SomeApplication

<Location /SOME_VALUE>
   ProxyPassReverse /SomeLocation/SomeApplication
</Location>


LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine On
RewriteCond %{HTTP:MyRoutingID} (.*)
RewriteRule .* - [E=ROUTING_ID:$1]

RewriteRule ^/(.*) http://myhost.domain/%{ROUTING_ID} [P,L]

The proxy config is working fine.  The RewriteRule however, does not.
Thanks for any help on getting the RewriteRule working.

Thanks!

/Paul

---------------------------------------------------------------------
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: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to