httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincenzo D'Amore" <>
Subject [users@httpd] Check if external url exists with standard Apache directives
Date Tue, 21 May 2013 08:17:00 GMT
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


View raw message