Search code examples
apachemod-rewritemod-proxy

RewriteRule, Proxy directive [P] - Is it possible to make request use actual proxy host?


Does anyone know whether it is possible to make rewrite rules which use the proxying [P] directive, as shown below, to behave like ProxyPass used in conjunction with ProxyPreserveHost Off.

In other words I want the server on mydomain.net to see a request for mydomain.net not mydomain.com.

RewriteCond  %{HTTP_HOST} ^mydomain.com$  [NC]
RewriteRule ^/(.*)$  http://mydomain.net/app1/$1 [P,L]


Thanks and best regards,


Solution

  • Since [P] actually uses mod_proxy, I'd try setting ProxyPreserveHost off and seeing if that does it.