title: POST request getting converted to GET when URL rewriting is done in apache httpd
body: <p>I have an apache web server that acts as a reverse proxy to internal app servers. I have used ProxyPass and ProxyPassReverse to achieve this. I have multiple context roots mapping to different applications.</p>
  
  <p>I am trying to remove the context root from the domain name for one context so that users can access the website directly as <a href="https://mydomain.com" rel="noreferrer">https://mydomain.com</a> instead of <a href="https://mydomain.com/contextRoot" rel="noreferrer">https://mydomain.com/contextRoot</a>. I have added the following rewrite rules instead of the proxypass and proxypassreverse configurations for this context.</p>
  
  <pre><code># redirecting old URL to new URL
  RewriteRule ^/contextRoot(.*)$ https://mydomain.com$1 [L,R=301]
  
  # proxying to internal app servers
  RewriteCond %{REQUEST_URI} !^(/anotherContextRoot1.*)$
  RewriteCond %{REQUEST_URI} !^(/anotherContextRoot2.*)$
  RewriteRule .* http://10.1.0.1:8080/contextRoot%{REQUEST_URI} [L,P]
  </code></pre>
  
  <p>This configuration works well for all http GET requests. For POST requests, the redirect happens, but the subsequent call becomes a GET.</p>
  
  <p>Please help me understand why this happens and how can I correct this. I also want to understand is there any more rewrite rule configuration that I have add to do what proxypassreverse used to do in the previous configuration.</p>