This is the sample network scenario -- one reverse-proxy server (http://www.company.com), proxying three internal servers -- portal.company.com, was1.company.com, and was2.company.com Proxying the portal is a piece of cake, so we'll start with that -- load and activate mod_proxy, and proxy the portal (I'm leaving out the ProxyMapping configuration on the J2EE engine, it's covered in previous posts): LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so ProxyVia on ProxyTimeout 600 ProxyRequests Off ProxyPass /irj http://portal.company.com:50000/irj ProxyPassReverse /irj http://www.company.com/irj ProxyPass /logon http://portal.company.com:50000/logon ProxyPassReverse /logon http://www.company.com/logon Both WASs (was1.company.com and was2.company.com) generate URLs which start with /sap following by a cookie. We need to use somekind of HTTP tracer to find out the URL patterns we can use to distinguish between the two. You can use any tracer -- HTTPWatch, ieHeaders, Live HTTP Headers extension for Firefox, or even general network tools like Ethereal. What we're looking for is the part of the URL which follows the cookie -- which directories on the server each web application uses. Let's say we traced the communications and we found the following URLs are used by the application on was1.company.com: http://was1.company.com/sap([long cookie string])/bc/bsp/sap/public/..... http://was1.company.com/sap([long cookie string])/bc/bsp/sap/zzz_yyy/..... and the application on was2.company.com retrieves files from the following URLs: http://was2.company.com/sap([long cookie string])/bc/bsp/sap/crm_bsp/..... http://was2.company.com/sap([long cookie string])/bc/bsp/sap/icons/..... (In some cases you might find that more than one internal server are trying to access a directory with the same name, like "/bc/bsp/sap/public" -- I don't know of a solution for this other than to rename the directories on some of the servers to differentiate the URLs.) Now that we've identified the URLs to forward we can start messing around with mod_rewrite. The following are the lines to load the module and activate it: LoadModule rewrite_module modules/mod_rewrite.so RewriteEngine On RewriteLog "/apache_rewrite.log" RewriteLogLevel 2 I've set the log-level to "2" in this case -- it's pretty detailed. 3 is even more detailed, and anything above that it too detailed in my opinion. After you got it working you'll probably want to lower the log-level to 1 or disable the log altogether. As I wrote earlier, the trick is to prepend a fixed string to the URLs and hand them over to mod_proxy for the actual redirection. Here's the statements: RewriteRule ^/sap(.*)/bc/bsp/sap/public(.*) http://was1.company.com/WAS1$0 [P] RewriteRule ^/sap(.*)/bc/bsp/sap/zzz_yyy(.*) http://was1.company.com/WAS1$0 [P] RewriteRule ^/sap(.*)/bc/bsp/sap/crm_bsp(.*) http://was2.company.com/WAS2$0 [P] RewriteRule ^/sap(.*)/bc/bsp/sap/icons(.*) http://was2.company.com/WAS2$0 [P] Let's break down one of the first line to understand it: ProxyPass /WAS1 http://was1.company.com ProxyPass /WAS2 http://was2.company.com Note the difference between these directives and the ones used for the portal -- in the portal we put "/irj" and "/logon" both in the source and the target of the directive (ProxyPass /irj), but in this case we only put "/WAS1" and "/WAS2" in the source. We do this because we want mod_proxy to remove the extra prefix we added using mod_rewrite. Another difference is that there's no ProxyPassReverse directive -- in my experience it was not needed since the URLs are usually relative. What you should do is make sure the web-server in the internal servers has the ProxyMapping function (or some similar function in a different environmnet) configured properly. And that's it -- it should be working now.