Webstacle: SSL and Favicon.ico

One of my web projects is an SSL-only system that pays attention to web server errors. I noticed this morning that the log was filling up with 404 errors from failed requests for favicon.ico, so I decided to add one.

I spent a few minutes putting together a reasonably accurate 16×16 version of the project’s icon, and referenced it in the head section of the project template. No big deal, it showed up in Firefox and, after some tweaking to make it look nice, I committed it and moved on. Then I went to Internet Explorer to get some screen shots for the client. Wham-o. No icon.
After an hour of futzing around, I found the problem: IE doesn’t like to use a favicon that’s loaded over SSL. Why? Who knows. So now when the client asks me why port 80 is open, I can’t say “Oh, that’s just a convenience for people who forget to type the ‘s’ in ‘https.'” No, I have to explain about IE and how fussy it is over the cute little icon in the corner of the address bar…

RewriteEngine on

RewriteCond %{HTTPS} off
# special exception just for you, IE
RewriteCond %{REQUEST_URI} !^/favicon.(ico|png)
RewriteRule ^/(.*) https://www.notdesignkitten.com/$1

2 replies on “Webstacle: SSL and Favicon.ico”

  1. What a pain in the a**. I’ve just come across this as well. Unfortunately I don’t have the ability to hack the server code like you do 🙁

Comments are closed.