views:

128

answers:

1

I want a user to be able to load a url in their browser, but not get redirected:

http://example.com/abc/{var1}/{var2}/def

I want the example.com apache 2.2 server to take that request, and "invisibly" and without redirect reverse proxy it to:

http://other.example.com/abc/{var1}/{var2}/def

I have spent hours trying different combinations of RewriteRule, ProxyPass, ProxyPassMatch, and ProxyPassReverse, all to no avail. Here is my current attempt, which seems to do a redirect to /test instead of an invisible proxy.

RewriteRule ^/abc/([^/\.]+)/([^/\.]+)/def/?$ /test/abc/$1/$2/def [P]
ProxyPass /test http://other.example.com/ 
ProxyPassReverse /test http://other.example.com/
A: 

The [P] flag already has the functionality of ProxyPass. You only need to add a ProxyPassReverse. Also, if you want to proxy, you must use a full url as the second operand of RewriteRule.

RewriteRule ^/abc/([^/\.]+)/([^/\.]+)/def/?$ http://other.example.com/abc/$1/$2/def [P]
ProxyPassReverse / http://other.example.com/
Artefacto
Unfortunately, that configuration produces an infinite 301 redirect loop. If I take out the ProxyPassReverse it redirects to the other server in the browser URL. Thoughts?
backplane
Post your logs (access log and rewrite log with rewriteloglevel 9).
Artefacto