httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Ralf S. Engelschall)
Subject Re: mod_proxy/1270: Add directive to locally mirror a site
Date Tue, 21 Oct 1997 07:30:13 GMT

In article <Pine.OS2.3.95.971020182333.213A-100000@localhost> you wrote:
> On 20 Oct 1997 wrote:

>> Synopsis: Add directive to locally mirror a site
>> This is already possible with the ProxyPass directive
>> (or with mod_rewrite).

> As I understand it, ProxyPass does exactly the opposite. It maps local
> requests to a remote server, what I want is to map remote requests to
> local files (or to the local server, or to any server, whatever is
> possible and easy to implement).

> However, as you mentioned, it is possible with mod_rewrite. It looks
> powerful enough to even redirect requests back to the original server if
> the requested file isn't available locally, but I'm not sure about that
> (that was one of the reasons I didn't look at this module before, I
> didn't know it was so advanced). 

> Anyway, thank you for your quick reaction. Your support is much better
> than that of many commercial companies :-) 

Instead of your suggested

  Mirror /mirror/of/remotesite/

one should be able to use the following (with Apache 1.3, with 1.2 you have to
shift the /mirror/of/remotesite/ into the current URL because of the lacking
$N interpolation in RewriteCond):

  RewriteEngine on
  RewriteCond   /mirror/of/remotesite/$1           -U 
  RewriteRule   ^http://www\.remotesite\.com/(.*)$ /mirror/of/remotesite/$1

I didn't tried it myself, but mod_rewrite theory says it should 
work like a charm, should't it?

                                       Ralf S. Engelschall

View raw message