title: Mod_rewrite is not working in apache
body: <p>I have configured apache http webserver 2.2.29 as a proxy. It's function is to redirect the incoming request to the backend server. Below is the flow.</p>
  
  <p>Client sends a request using url <code>https://iproxy.company.co.uk:8443/cis1</code>. Apache instance is listening on <code>iproxy.company.co.uk:8443</code>. This request has to be sent to a backend server on url <code>https://i.company.co.uk:8443</code>. To achieve this I have used mod_rewrite. Below is configured in httpd-alias.conf file.</p>
  
  <pre><code>   `Listen iproxy.company.uk:8443
  </code></pre>
  
  <p></p>
  
  <pre><code>    ServerName      iproxy.company.uk:8443
  
      DocumentRoot    /app/
      RewriteEngine On
      RewriteRule (.*)$ https://i.company.co.uk:8443$1 [R=301,L]
      ProxyPassReverse "/products/widget/" "http://product.example.com/widget/"
      RewriteLog /app/instance1/logs/rewrite.log
      RewriteLogLevel 5
  
      ErrorLog "/app/instance1/logs/error_log"
      TransferLog "/app/instance1//logs/access_log"
  
      SSLEngine on
      SSLProtocol all -SSLv2 -SSLv3
      SSLCipherSuite HIGH:!MEDIUM:!aNULL:!MD5:!RC4
      SSLCertificateFile "/app/certificates/star.cer"
      SSLCertificateKeyFile "/app/certificates/star.key"
      SSLCertificateChainFile "/app/certificates/rootCAChain.pem"
      CustomLog "/app/instance1/logs/ssl_request_log" \
        "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
     &lt;/VirtualHost&gt;`
  </code></pre>
  
  <p>I have also configured the rewrite loggin to level 5. I am getting below in rewrite logs.</p>
  
  <p>I am hitting below command to check if redirection works</p>
  
  <p><code>curl -k https://iproxy.company.co.uk:8443/cis1</code></p>
  
  <p>Getting below output</p>
  
  <p><code>&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt;
      &lt;html&gt;&lt;head&gt;
      &lt;title&gt;301 Moved Permanently&lt;/title&gt;
       &lt;/head&gt;&lt;body&gt;
      &lt;h1&gt;Moved Permanently&lt;/h1&gt;
       &lt;p&gt;The document has moved  &lt;ahref="http://i.company.co.uk:8443/cis1"&gt;here&lt;/a&gt;.&lt;/p&gt;
       &lt;/body&gt;&lt;/html&gt;</code></p>
  
  <p>I can also see below is printed in the rewrite logs.</p>
  
  <p><code>redirect to https://i.company.co.uk:8443/ci1 [REDIRECT/301]</code></p>
  
  <p>hence I am assuming that redirection is working fine. However.it is not..as server is not getting any request? am I doing anything wrong in the configuration.</p>
  
  <p>UPDATE:
  I have updated the RewriteRule directive by adding [P] at the end, which worked and my issue got resolved.</p>
  
  <p><code>RewriteRule (.*)$ https://sit-alfresco.rpmi.co.uk:443$1 [P]</code></p>