How to use Apache's Proxy on Drupal's Files directory

Drupal's files directory can get enormous, and it's best not to keep it in version control. Here's a way to use Apache's proxy module to point your local environment directly to your dev/live site's files directory so you don't have to download it.

In your httpd.conf:

  1. ProxyRequests On
  2. ProxyVia On
  3.  
  4. <Proxy *>
  5.     Order deny,allow
  6.     Deny from all
  7.     Allow from localhost
  8.     Allow from all
  9. </Proxy>
  10.  
  11. <Location /sites/default/files/imagecache/>
  12.    ProxyPass http://dev.yoursite.com/sites/default/files/imagecache/
  13. </Location>

Of course you'll want to tailor it to your needs; maybe you want only one imagecache preset proxied, or just one directory specifically on one local host. Either way, this recipe will get you started. Hope it helps!