title: Apache redirect with mod_proxy, mod_rewrite
body: <p>I need configureproxy redirect using Apache,mod_rewrite, mod_proxy.
  I have next:</p>
  
  <pre><code>WEBLogic Node1: ip: 10.0.0.3 port:7003 (not SSL)
  WEBLogic Node2: ip: 10.0.0.4 port:7004 (not SSL)
  WEBLogic Apache: ip: 10.0.0.5 ports: 80,443 (Apache Server Balancer)
  </code></pre>
  
  <h2>In result i should get:</h2>
  
  <pre><code>http://10.0.0.5/manage (redirect) -&gt; httpS://10.0.0.5/faces/login (In browser user must see /manage) -&gt; HTTP balancer
  httpS://10.0.0.5/manage (redirect)-&gt; httpS://10.0.0.5/faces/login (In browser user must see /manage) -&gt; HTTP balancer
  </code></pre>
  
  <p>Server 10.0.0.5 has HTTP balancer to the WEBLogic nodes: 1,2</p>
  
  <h2>I configure next:</h2>
  
  <pre><code>NameVirtualHost *:80
  NameVirtualHost *:443
  
  &lt;VirtualHost *:80&gt;
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  # log
  RewriteLog /var/log/mod_rewrite.log
  RewriteLogLevel 6
  
  # redirect to SSL connection
  RewriteCond %{REQUEST_URI}  ^/manage/?$
  RewriteCond %{SERVER_PORT} 80
  # R=301 sends HTTP Moved Permanently L=Last rule for this request
  RewriteRule ^(.*)$ https://%{SERVER_NAME}/faces/login [R,L]
  &lt;/IfModule&gt;
  
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:443&gt;
  # SSL
  SSLEngine on
  SSLProxyEngine On
  SSLProtocol all -SSLv2 -SSLv3
  SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:!LOW:!SSLv2:!EXPORT
  SSLCertificateFile /etc/apache2/certs/host.pem
  SSLCertificateKeyFile /etc/apache2/certs/host.key
  
  
  # mod_rewrite
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  # log
  RewriteLog /var/log/mod_rewrite.log
  RewriteLogLevel 6
  
  # redirect to SSL connection
  RewriteCond %{REQUEST_URI}  ^/manage/?$
  RewriteCond %{SERVER_PORT} 443
  # R=301 sends HTTP Moved Permanently L=Last rule for this request
  RewriteRule ^(.*)$ https://%{SERVER_NAME}/faces/login [R,L]
  &lt;/IfModule&gt;
  
  ##########################
  # MOD PROXY
  ##########################
  # logs
  LogFormat "%t - %h - %{BALANCER_WORKER_NAME}e - \"%r\" - %&gt;s - %b" custom
  LogLevel warn
  CustomLog "/var/log/apache2/custom_balancer.log" custom
  ErrorLog  "/var/log/apache2/error_balancer.log"
  
  # proxy
  ProxyRequests Off
  ProxyPreserveHost On
  ProxyVia On
  ProxyTimeout 1200
  
  SSLEngine on
  SSLProxyEngine On
  
  &lt;Proxy balancer://http_test_cluster&gt;
  BalancerMember http://10.0.0.3:7003/faces/login loadfactor=10 retry=120 connectiontimeout=15 timeout=30
  BalancerMember http://10.0.0.4:7004/faces/login loadfactor=10 retry=120 connectiontimeout=15 timeout=30
  ProxySet lbmethod=byrequests timeout=25
  &lt;/Proxy&gt;
  
  # balance manager tool has gui
  &lt;Location /balancer-manager&gt;
  SetHandler balancer-manager
  Order deny,allow
  Allow from all
  &lt;/Location&gt;
  ProxyPass /balancer-manager !
  
  ProxyPass /faces balancer://http_test_cluster/manage
  ProxyPassReverse / http://10.0.0.3:7003/faces/login
  ProxyPassReverse / http://10.0.0.4:7004/faces/login
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>But, it is not works. 
  I got repeated errors:</p>
  
  <pre><code>(1) pass through /faces/login
  (2) init rewrite engine with requested uri /balancer-manager
  (3) applying pattern '^(.*)$' to uri '/balancer-manager'
  (4) RewriteCond: input='/faces/login' pattern='^/manage/?$' =&gt; not-matched
  </code></pre>
  
  <p>What Is wrong?
  Thanks.</p>