httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yehuda Katz <>
Subject Re: [users@httpd] Check if external url exists with standard Apache directives
Date Tue, 21 May 2013 13:07:54 GMT
Your question looks similar to this StackOverflow question:

I am guessing from your question that you can't even change that much on
the 'destination' server.
I have also looked for a way to do this and come up empty.

- Y

On Tue, May 21, 2013 at 4:17 AM, Vincenzo D'Amore <>wrote:

> Hi all,
> I'm moving a big directory of images from an HTTP server to another and I
> cannot change any configuration. I would like my users don't even suppose
> there is a moving in progress. So I thought to add a new Apache httpd
> server 2.2 configured as reverse proxy in front of both of those servers.
> Let me say, we can call those servers 'origin' and 'destination'.
> Apache when a resource does not exists in the destination should try to
> get it in the origin server.
> I suppose to do this check, I mean if the resource exist or not in
> 'destination' server, using mod_rewrite, I mean RewriteCond -U option.
> Actually my tentative has failed, it seems impossible check the existence
> of external resource using only standard apache 2.2 directives.
> This is my tentative:
>     RewriteCond %{IS_SUBREQ}    true
>     RewriteCond %{REQUEST_FILENAME} ^/destination
>     RewriteRule .       http://destination-server%{REQUEST_FILENAME} [P,L]
>     # Check "destination" requests
>     RewriteCond %{IS_SUBREQ}    false
>     RewriteCond "/destination%{REQUEST_FILENAME}" -U
>     RewriteRule . http://destination-server%{REQUEST_FILENAME} [P,L]
>     RewriteCond %{IS_SUBREQ}    false
>     RewriteRule .            http://origin-server%{REQUEST_URI}      [P,L]
> Is there any way to do this using mod_rewrite or some standard Apache
> httpd module?
> Ciao,
> Vincenzo

View raw message