Skip to content

Instantly share code, notes, and snippets.

@creativecoder
Last active March 8, 2017 23:55
Show Gist options
  • Save creativecoder/6162260 to your computer and use it in GitHub Desktop.
Save creativecoder/6162260 to your computer and use it in GitHub Desktop.
Apache redirect for missing images
# Place inside a <VirtualHost> or <Directory> declaration
#
# Particularly useful for displaying images in a local development environment
# without actually downloading all of the images
#
# Props to Mark Jaquith for the suggestion at WordCamp SF 2013
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*)(png|jpg|jpeg|gif|svg)$ http://www.example.com$1$2 [L]
@alettieri
Copy link

Woot!

@menslow
Copy link

menslow commented Aug 6, 2013

Grant FTW!

Might want to add svg to the list.

@lschatzkin
Copy link

Look how nice you are, giving props to Jaquith.

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