I have 2 web applications installed in the same server, and want to use the same domain for both.
I already have an apache2 running on port 80, and both apps running on ports 8081 and 8082 respectively.
I’m having trouble configuring the the rewrite rule to accomplish the following:
When the user goes to ://domain/aaa I’d like to (silently) rewrite to ://localhost:8082/aaa, and when the user goes to ://domain/sub/aaa, to rewrite to ://localhost:8083/aaa
How can I accomplish that? (of course the user should not be aware of the redirect, as in, the url in the browser should remain the same)
You need more then just mod_rewrite to do this. One way of doing this is by setting up a reverse proxy with mod_proxy for two virtual hosts (one each app) that include something like: