Dealing with Internet Explorer 6 and png-transparency
Internet Explorer 6 (and below) is evil, since it apparently doesn’t support png-transparency which means that my new pretty thumbnails looked like crap. After asking around a bit in #apache@freenode and browsing the mod_rewrite manual of apache I came up with a nice solution.
At my server i have a thumbs/ folder containing the thumbnails (in png format). I then made a new set of IE6 friendly thumbnails, that were uglier but at least didn’t look insanely weird like the messed up pngs. I chose to save these as jpgs for no real reason. Its probably smarter to use gif but IE6 users aren’t picky, if they were then they wouldn’t use IE6.
So in my thumbs/ folder I now have a double set of thumbs, with the same name except the extension.
I then added this to .htaccess in thumbs/
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} MSIE\\ [^7]
RewriteRule ^(.*)png$ /thumbs/$1jpg [R]
To explain, all users of Internet Explorer of a different version than 7 will have all png-files in the directory redirected to the jpg files. They will not be as pretty, but it’s a quite nice fix
All other solutions for png-transparency I’ve seen have been only for displaying them on your own page, but since I encourage hotlinking, that would not work here. This does so beautifully though
Recent Comments