The Apache documentation states that RewriteRule should be placed in the server configuration, but they can be placed in htaccess due to co-location situations. I am in such a situation.
I am trying to configure a transparent proxy:
RewriteEngine On RewriteCond %{REQUEST_URI} ^/foo [OR] RewriteCond %{REQUEST_URI} ^/bar RewriteRule ^(.*)$ http://example.com/$1 [P]
This works fine ... except for redirection (for example, if /foo redirected to /bar ). Redirects return to example.com and not to my server.
I understand that the ProxyPassReverse directive ProxyPassReverse solve this, but I get the "Internal Server Error" page when I add it to .htaccess
Unlike Rewrite directives, ProxyPassReverse will not work in htaccess .
How to configure a transparent proxy server in a situation with shared hosting, or is it impossible?
(This seems reasonable, since Rewrite already gets 80% of the path, and having a transparent proxy in one htaccess will not prevent it from having it in another.)
apache proxy .htaccess transparentproxy
Paul draper
source share