modrewrite to another server if file/image is not found
- by Traveling_Monk
Hi I am working on a locally served copy of a remote site and I don't want to have to download all the images rtelated to the site so I thought i could come up with a mod_rewrite rule for to grab images from the remote server if the are not found this is the code that i have
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [NC]
RewriteRule ^/(.*\.(png|gif|jpg|jpeg)) https://www.exmple.com/$1 [NC,P,L]
</IfModule>
The page is still giving me 404's for images that are on the remote server, so this rule is not working.
I do know that the htaccess is being processed because rules later in the IfModule mod_rewrite.c block are being used.
(i simplified my code sample but this is the first rule in the IfModule mod_rewrite.c block)