Created
April 6, 2014 15:47
-
-
Save vangog/10007832 to your computer and use it in GitHub Desktop.
Check "files" folder into Drupal
From 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
### Apache Rewrite | |
# 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] | |
### nginx Rewrite | |
## Try local files first, otherwise redirect to a development server. | |
location ^~ /sites/default/files { | |
try_files $uri @dev_redirect; | |
} | |
## Development Server Redirect | |
location @dev_redirect { | |
rewrite ^ http://dev.example.com$request_uri? permanent; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment