httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Arnold <>
Subject Re: [users@httpd] Rewrite Rule Help (again)
Date Wed, 11 Jul 2012 03:22:27 GMT
>You may need to change the R to a P:

>RewriteEngine On
>RewriteCond %{HTTP_HOST} !^$ [NC]
>RewriteRule ^/$ http://private.ip.address/ [P,L]

This sends all http traffic to the private ip server

>This turns the rule into a proxy to that private IP, assuming that is
>what you are trying to accomplish.

I am not sure what the "technical" name is of what i am trying to do. The lines between rewrite
and proxy are blurred to say the least. That is why i have tried to give an accurate description
of what i am trying to do.

>Finally, if you want URLS other than the root to be proxied, you may
>need to capture the URI like so:

>RewriteEngine On
>RewriteCond %{HTTP_HOST} !^$ [NC]
>RewriteRule ^/(.*)$ http://private.ip.address/$1 [P,L]

Because the first suggestion did not work, i tried this one and it sends all http traffic
to the iis server too.
Just to maybe giv a better account of what i am trying to do. We have a webserver (say webserv
A) that fulfills http port 80 requests and uses apache. We have another webserver that runs
a program that requires it to run on 80 and uses iis. We have 1 public ip, with public dns
entries for a number of hostnames and matching private dns entries. The firewall sends all
port 80 traffic to the apache server. We need only (this will come to the
apache server) to be redirected/proxied to the iis server. We need the other websites,
and the other sites to still be served on the apache server. Here is the
first part of the vhost file:
<VirtualHost *:80>

    #SSLProxyEngine On
    #ProxyPass /ifolder/
    #ProxyPassReverse /ifolder/
    RewriteEngine On
    RewriteRule ^/ifolder(.*) https://%{HTTP_HOST}/ifolder/ [L]
    RewriteRule ^/admin(.*) https://%{HTTP_HOST}/admin/ [L]
    RewriteCond %{HTTP_HOST} !^$ [NC]
    RewriteRule ^/(.*)$$1 [P,L]

I hoped this clears up some stuff up and makes it clear what i need apache to do.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message