title: How do I configure an apache server to serve static content and route all other traffic to second host?
body: <p>I have Apache (2.4) running locally serving port 80 and would like it to directly serve some static content (css/js/etc). I have a weblogic server running on port 8007 that will serve up all the dynamic web pages. I would like some of the static content to be served from the Apache server directly and all other URLs to be routed to the weblogic server. The static content and dynamic content all need to have the same context root (/myRoot). I am trying to use mod_proxy. Here is the current relevant config in httpd.conf which I have tried (assume localhost.mydomain.com maps to 127.0.0.1):</p>
  
  <pre><code>ServerName localhost.mydomain.com:80
  ...
  ProxyRequests On
  ProxyVia On
  ...
  ProxyPass "/myRoot" "http://localhost.mydomain.com:8007/myRoot"
  ProxyPassReverse "/myRoot" "http://localhost.mydomain.com:8007/myRoot"
  </code></pre>
  
  <p>I need the static content URL to be like this and served from Apache directly:
  <a href="http://localhost.mydomain.com/myRoot/static" rel="nofollow noreferrer">http://localhost.mydomain.com/myRoot/static</a></p>
  
  <p>The above configuration allows me to connect to the weblogic server running on port 8007 correctly. However Im struggling to get the static content served from the Apache web server. I can get content from htdocs from the apache server but if I put a directory like /htdocs/myRoot/static the static content is still going to the weblogic server.</p>