I do a lot of apache rewrite rules at work and have typically relied on using the [P] proxy flag to proxy content. However, this has performance implications since
it does not pool connections. In fact Apache documentation specifically mentions this
The solution was to change to use
However, we ran into an issue with this. With
RewriteRule doing the proxying you control the flow of rewrites. With
ProxyPassMatch they are executed AFTER.
The solution to this was to escape any rewrite rules before doing the proxy.
Now any reverse proxies work as expected without rewrite rule processing before them.