Last active
December 19, 2015 14:39
-
-
Save allybee/29fb76fd0e40b29937ea to your computer and use it in GitHub Desktop.
Placed in wherever your media is uploaded, this will check your local media directory for a requested file and, if it doesn’t exist, attempt to load it from production. This makes it easier to work on a local copy of a production site since you won’t need your own copy of the media directory.
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
# concrete5 | |
# files/.htaccess | |
# NOTE: This doesn't work for images that are created with concrete5's getThumbnail() | |
# Attempt to load files from production if they're not in our local version | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
Options +FollowSymlinks -MultiViews | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# Replace http://domain.com with your production site's domain name | |
RewriteRule (.*)$ http://domain.com/files/$1 [R,L,NC] | |
</IfModule> | |
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
# Wordpress | |
# wp-content/uploads/.htaccess | |
# Attempt to load files from production if they're not in our local version | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
Options +FollowSymlinks -MultiViews | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# Replace http://domain.com with your production site's domain name | |
RewriteRule (.*) http://domain.com/wp-content/uploads/$1 | |
</IfModule> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment