Home » Questions » Computers [ Ask a new question ]

How do I forward requests to another URL without actually changing the URL in Apache?

How do I forward requests to another URL without actually changing the URL in Apache?

I have Apache running in a domain, for example http://example.com. I also have Tomcat running on my server and I've forwarded all requests made to http://example.com/t/ to Tomcat and all other URLs are served by Apache directly.

Asked by: Guest | Views: 255
Total answers/comments: 1
bert [Entry]

"You should use the 'P' (proxy) option on the mod_rewrite rule to be done internally to the server. You will also need to enable mod_proxy.

from the mod_rewrite docs:

'proxy|P' (force proxy)

This flag
forces the substitution part to be
internally sent as a proxy request and
immediately (rewrite processing stops
here) put through the proxy module.
You must make sure that the
substitution string is a valid URI
(typically starting with
http://hostname) which can be handled
by the Apache proxy module. If not,
you will get an error from the proxy
module. Use this flag to achieve a
more powerful implementation of the
ProxyPass directive, to map remote
content into the namespace of the
local server.

Note: mod_proxy must be enabled in
order to use this flag."