Skip to content

Instantly share code, notes, and snippets.

View webthingee's full-sized avatar

Sean Lange webthingee

View GitHub Profile
@webthingee
webthingee / gist:6185134
Created August 8, 2013 14:34
rewrite in MAMP for offsite files
### Apache Rewrite
<IfModule mod_rewrite.c>
RewriteEngine on
# Force image styles that have local files that exist to be generated.
RewriteCond %{REQUEST_URI} ^/sites/([^\/]*)/files/styles/[^\/]*/public/((.*))$
RewriteCond %{DOCUMENT_ROOT}/sites/%1/files/%2 -f
RewriteRule ^(.*)$ $1 [QSA,L]
# Otherwise, send anything else that's in the files directory to the
# production server.
RewriteCond %{REQUEST_URI} ^/sites/[^\/]*/files/.*$