Last active
March 8, 2016 09:31
-
-
Save palicko/fba8e5d95d981c6e8c1e to your computer and use it in GitHub Desktop.
Load media files from production server if they don't exist locally
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load media files from production server if they don't exist locally | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{HTTP_HOST} ^localsite\.dev$ | |
RewriteRule ^wp-content/uploads/(.*)$ http://remotesite.com/wp-content/uploads/$1 [NC,L] | |
</IfModule> | |
# Another way | |
RewriteCond %{REQUEST_FILENAME} !-f [NC] | |
RewriteRule ^wp-content/uploads/(.*)$ http://dev2.webikon.sk/softec/wp-content/uploads/$1 [NC,R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment