I hope the title is understandable. I have a site
example.com that uses a PHP framework and this other site that runs on a NodeJS framework. Right now, if you navigate to
example.com:8000 you will be on the NodeJS site. What I am trying to achieve is that if you go to
example.com/foo you will be on the NodeJS site. Notice that it is just a path and there are no subdomains or ports seen (at least by the end user).
In the vhost file, I used an apache
Location directive to try and achieve this, similar to the following.
ServerName example.com <Location /foo> ProxyPass http://example.com:8000/ ProxyPassReverse http://example.com:8000/ </Location>
The good news is that when I go to
example.com/foo I am on the NodeJS site. However, all the static assets (such as CSS and JS) are being loaded from
example.com/styles instead of
example.com/foo/styles (the Node site)? Short of rewriting all the links on the page to start with
/foo, is there something I can tweak in the Apache rules to achieve this?
I found the
Location directive in the Apache 2.2 docs, but not much rewriting links to these assets.