I have got a CakePHP application, and also the following directives during my httpd.conf

ProxyRequests off
ProxyPass /forum/ http://somesite.com/phpbb3
ProxyPass /gallery/ http://someothersite.com/gallery3
<Location /forum/>
        ProxyPassReverse /
<Location /gallery/>
        ProxyPassReverse /

Without CakePHP this works fine - but because CakePHP is applying it's own redirection logic from routes.php along with other sources, it appears to override any proxy configurations, so any call to "/community" on my small server follows the default path of searching for a Controller known as CommunityController.

My problem here's that I wish to have one server that serves muliple programs, but ensure that it stays seamless towards the user - so an entire PHPBB application can for example run inside the "/forum" directory as though it were a controller in CakePHP.

Has anybody carried this out before, and will it be achieved? How come mod_rewrite and/or even the routes.php file override my mod_proxy directives??

Possibly rather than using mod_proxy, you could utilize mod_rewrite to produce a RewriteRule directive using the [P] (proxy) flag with the [L] (last rule) flag.

'proxyP' (pressure proxy):

This flag forces the substitution part to become internally sent like a proxy request and immediately (rewrite processing stops here) subjected to the proxy module. You have to make certain the substitution string is really a valid URI (typically beginning with http://hostname) which may be handled through the Apache proxy module. Otherwise, you're going to get a mistake in the proxy module. Make use of this flag to attain a more effective implementation from the ProxyPass directive, to map remote content in to the namespace from the local server.

Note: mod_proxy should be enabled in to make use of this flag.

'lastL' (last rule):

Steer clear of the spinning process here and do not apply anymore rewrite rules. This matches the Perl last command or even the break command in C. Make use of this flag to avoid the presently rewritten URL from being rewritten further by using rules. For example, utilize it to rewrite the root-path URL ('/') to some real one, e.g., '/e/www/'.