Skip to content

Instantly share code, notes, and snippets.

@murtaugh murtaugh/.htaccess
Last active Jun 1, 2016

Embed
What would you like to do?
Convince ExpressionEngine to show SVG thumbnails
# redirect requests to (non-existent) SVG thumbnails to the main image
RewriteRule ^/assets_content/_thumbs/?\.svg$ /assets_content/$1.svg [NC,L]
# FWIW, I had to swap out the ? for (.*) in my environment
/* make sure the svg thumbnail doesn't blow out the page; give it a checkerboard background */
.publish_field .filename img[src$=".svg"] {
width: 100px;
max-width: 100%;
padding: 12px;
background-color: rgba(0,0,0,.05);
background-image: linear-gradient(45deg, rgba(0,0,0,.05) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.05) 75%, rgba(0,0,0,.05)),
linear-gradient(45deg, rgba(0,0,0,.05) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.05) 75%, rgba(0,0,0,.05));
background-size: 40px 40px;
background-position: 0 0, 20px 20px;
}
@blainsmith

This comment has been minimized.

Copy link

commented Jan 5, 2016

Nice! Glad you got it working!

@murtaugh

This comment has been minimized.

Copy link
Owner Author

commented May 19, 2016

FYI, for Dreamhost I had to remove the leading /:

RewriteRule ^assets_content/_thumbs/?\.svg$ /assets_content/$1.svg [NC,L]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.