Reputation: 3079
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/
Upvotes: 3
Views: 7129
Reputation: 97835
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/
Upvotes: 0