Skip to content

Instantly share code, notes, and snippets.

@jacine
Created December 1, 2011 23:10
Show Gist options
  • Save jacine/1420589 to your computer and use it in GitHub Desktop.
Save jacine/1420589 to your computer and use it in GitHub Desktop.
My favorite Drupal trick for local theme development
# Find this line and insert the code below it (adapted to use your sitename/server).
# RewriteBase /
# Use files on the dev server instead of syncing them locally.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^sites/sitename/(files/.*)$ http://dev.whatever.com/sites/sitename/$1 [L,QSA]
@msonnabaum
Copy link

Alternatively, you could:

drush dl stage_file_proxy && drush -y en stage_file_proxy

Then put this in your settings.php:

<?php
$conf['stage_file_proxy_origin'] = 'http://dev.whatever.com';

@ezra-g
Copy link

ezra-g commented Dec 1, 2011

The advantage of the stage file proxy module is that it "...transfers each requested file just in time when it is requested" which is generally faster for local development than hotlinking to the production site, and also gives you the benefit of having the files to work with locally eg for imagecache manipulations when you request the original file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment