Using Remote Images when you develop Locally

Public

by Sean Lange on August 21, 2013 // Senior Front-End Developer at Lullabot

Get raw version
bash
  1. ### Apache Rewrite
  2. <IfModule mod_rewrite.c>
  3. RewriteEngine on
  4. # Force image styles that have local files that exist to be generated.
  5. RewriteCond %{REQUEST_URI} ^/sites/([^\/]*)/files/styles/[^\/]*/public/((.*))$
  6. RewriteCond %{DOCUMENT_ROOT}/sites/%1/files/%2 -f
  7. RewriteRule ^(.*)$ $1 [QSA,L]
  8. # Otherwise, send anything else that's in the files directory to the
  9. # production server.
  10. RewriteCond %{REQUEST_URI} ^/sites/[^\/]*/files/.*$
  11. RewriteCond %{REQUEST_URI} !^/sites/[^\/]*/files/css/.*$
  12. RewriteCond %{REQUEST_URI} !^/sites/[^\/]*/files/js/.*$
  13. RewriteCond %{REQUEST_FILENAME} !-f
  14. RewriteCond %{REQUEST_FILENAME} !-d
  15. RewriteRule ^(.*)$ http://www.example.com/$1 [QSA,L]
  16. </IfModule>