2718.us blog » image files http://2718.us/blog Miscellaneous Technological Geekery Tue, 18 May 2010 02:42:55 +0000 en hourly 1 http://wordpress.org/?v=3.0.4 Apache’s MultiViews Option http://2718.us/blog/2009/11/04/apaches-multiviews-option/ http://2718.us/blog/2009/11/04/apaches-multiviews-option/#comments Wed, 04 Nov 2009 15:38:59 +0000 2718.us http://2718.us/blog/?p=200 … or “how to serve different image types at one URL.”

… or “why I let myself get carried away reading from one blog post to another.”

After discovering free and cheap SSL certificates, I was playing with some sites over HTTPS to see what different browsers would show for the security.  Very quickly, I noticed that having any elements on the page that aren’t loaded over HTTPS causes the whole page to be marked as not secured.  One element in particular on one page was this “valid” icon from w3.org.  Note that the URL, http://www.w3.org/Icons/valid-xhtml10-blue,  doesn’t have any file-type extension on it.  Since w3.org doesn’t provide the icon over HTTPS (though they are fine with hotlinking the HTTP version), I needed to move it to my own server.  I went to look for the image file and didn’t find a “valid-xhtml10-blue” file with no extension.  What I found were several files with that base name and different extensions.  I couldn’t find any information in the w3.org docs or in the source for the validator, which includes all the validation icons, as to how this was achieved.  I googled to no avail.

Not long after that, I noticed an update for Bad Behavior was available and went to read the release notes.  After reading the release notes, a post about the future major version of Bad Behavior caught my eye.  In that post–no, actually in the comments on that post–there was a mention of getting rid of Apache for performance reasons.  In reading that post, in the discussions of the pros and cons of nginx versus Apache, “content negotiation” was described, and suddenly I understood how to serve the multiple image file types at one type-extension-less URL, like w3.org did.  A quick googling led me to MultiViews.

One line in an .htaccess file and it’s done:
Options +MultiViews

]]>
http://2718.us/blog/2009/11/04/apaches-multiviews-option/feed/ 1