title: How to set up proxy in .htaccess
body: <p>The Apache documentation states that RewriteRule and the should be put in the server configuration, but they can be put in htaccess because of shared hosting situations. I am in such a situation.</p>
  
  <p>I am trying to set up a transparent proxy:</p>
  
  <pre><code> RewriteEngine On
   RewriteCond %{REQUEST_URI} ^/foo [OR]
   RewriteCond %{REQUEST_URI} ^/bar
   RewriteRule ^(.*)$ http://example.com/$1 [P]
  </code></pre>
  
  <p>This is working fine...except for redirects (like if <code>/foo</code> redirects to <code>/bar</code>). Redirects go back to example.com, not my server.</p>
  
  <p>I understand the the <code>ProxyPassReverse</code> directive will solve this, but I get an "Internal Server Error" page when I add this to <code>.htaccess</code></p>
  
  <p>Unlike the Rewrite directives, <a href="http://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypassreverse" rel="noreferrer"><code>ProxyPassReverse</code> will not work in htaccess</a>.</p>
  
  <p>How do I set up a transparent proxy in shared hosting situation, or is this not possible?</p>
  
  <p>(This seems reasonable, since Rewrite already gets 80% of the way there, and having a transparent proxy in one htaccess would not interfere with having it in another.)</p>