Last active
December 15, 2015 19:39
-
-
Save chales/5312358 to your computer and use it in GitHub Desktop.
For local (Drupal) sites where you don't want to eat up drive space from file syncs, have apache pull them from the production sites instead.
http://getlevelten.com/blog/mark-carver/dont-sync-drupal-files-local-environments-redirect-them-instead
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
<VirtualHost 0.0.0.0:80> | |
ServerName mysite.sandbox | |
DocumentRoot /path/to/mysite.sandbox | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
# Request resides in your 'sites/default/files' folder. | |
RewriteCond %{REQUEST_URI} ^/sites/default/files/(.*)$ | |
# File doesn't exist. | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# Directory doesn't exist. | |
RewriteCond %{REQUEST_FILENAME} !-d | |
# Redirect request to your development or production server. | |
RewriteRule ^/sites/default/files/(.*)$ http://dev.example.com/sites/default/files/$1 [L] | |
</IfModule> | |
<Directory /path/to/mysite.sandbox> | |
Options FollowSymLinks | |
Order allow,deny | |
Allow from all | |
</Directory> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment