Redirect/rewrite for external sites using Apache as forward proxy

Discussion in 'Apache' started by slipstock, Nov 12, 2012.

  1. #1
    I've got a rather unique requirement that I'm hoping someone can help with. It should be pointed out that I'm new to Apache as well.

    We are using Apache as a forward proxy that all clients use to access the internet. For certain websites, we need to redirect users to an initial "disclaimer" or legal page when they first visit. So, for example, a user browses to http://www.somesite.com/ and gets redirected to http://www.somesite.com/legal.html. These websites are not under our control and are external to us. I know this is kind of convoluted, but that's the way it goes sometimes. The legal disclaimers are always on the same site, so it will always be the case that redirections will be of the form:


    http://www.a.com/ => http:/www.a.com/disclaimer.htm
    http://www.b.com/ => http:/www.b.com/legal.htm
    http://www.c.com/ => http:/www.c.com/readthisfirst.htm


    I've been experimenting with Redirect and RewriteRule, but haven't quite been able to work out how to accomplish this. My default VirtualHost has ProxyRequests On. However, none of the Redirect or RewirteRule entries that I add to the VirtualHost seem to work. If I create a new VirtualHost entry for one of the sites in question, I can get Redirect/RewriteRule to work, but only if ProxyRequests is off. The problem with this is that I can only get it to redirect to a different site, not to a different page within the same one.

    I'm a bit lost here. Any help would be appreciated.
     
    slipstock, Nov 12, 2012 IP