httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Cicimov <>
Subject Re: [users@httpd] Redirect to other server if file/directory does not exists.
Date Tue, 05 Aug 2014 12:40:52 GMT
> RewriteCond %{REQUEST_URI} ^/(.*)$
> RewriteRule ^/(.*)$ http://other-server/%1 [P,L]
> Does not work. Local resources if esists are shown, but remote resources
> are 404 not found "/". Nor %{REQUEST_FILENAME} helps.

You have probably some other rule interfering before this one. Anyway,
enable mod_rewrite logging and check in the logs what's going on.

See RewriteLog and RewriteLogLevel.

Also no need of the 3rd RewriteCond, since you want to use the REQUEST_URI
just write:

RewriteRule ^/(.*)$ http://other-server%{REQUEST_URI} [P,L]

View raw message