How to use Apache to proxy from subfolder to other server

5,615

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]

Share:
5,615

Related videos on Youtube

omeyn
Author by

omeyn

Updated on September 18, 2022

Comments

  • omeyn
    omeyn almost 2 years

    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.

  • omeyn
    omeyn over 12 years
    This looks right, and here's a nice example of how to do what I'm looking for: apachetutor.org/admin/reverseproxies