How to use Apache to proxy from subfolder to other server

apache-2.2mod-proxymod-rewritePROXYrewrite

Given the following url:

domain.com/wiki/

I'd like apache to redirect all requests below that (so domain.com/wiki/*) to otherdomain.com:8080/. But the trick is I want the user to always see domain.com/wiki/. And the webapp on otherdomain thinks it's running at the root level, so has internal links to css and images and such that are like /css/style.css. Those urls need to be rewritten to /wiki/css/style.css.

The following config gets mostly there but is missing the /css & /images rewrite solution:

ProxyRequests Off
ProxyPass /wiki/ http://otherdomain.com:8080/
ProxyPassReverse /wiki/ http://otherdomain.com:8080/

Any and all help appreciated.

Best Answer

I think you need to use something like ProxyHTMLURLMap.
If I remember it correctly it would work like this:

ProxyHTMLURLMap http://domain.com/wiki/css http://otherdomain.com:8080/css [R]