WebPagetest Forums
favicon content type - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Optimization Discussions (/forumdisplay.php?fid=5)
+--- Thread: favicon content type (/showthread.php?tid=8257)



favicon content type - Joel - 11-17-2011 10:00 AM

I asked my developer to add to the .htaccess file the following line under <IfModule mod_expires.c>
ExpiresByType image/ico "access plus 1 years" to set an expire date for the favicon
But it didn't have an expire date, couldn't figure it out till I loaded the icon in Firefox and noticed this part of the response headers
Quote:Content-Type: text/plain; charset=WINDOWS-1251
strange, no?
I downloaded the favicon, uploaded on a different site and everything was fine, can you help me understand what the issue here isHuh

Thanks much


RE: favicon content type - pmeenan - 11-17-2011 11:13 AM

You should be able to add

Code:
<IfModule mod_mime.c>
    AddType image/ico .ico
</IfModule>

to get Apache to set the correct mime type for the favicon.


RE: favicon content type - laboot - 11-22-2011 07:02 AM

Google uses: "Content-Type: image/x-icon". Me too.

While correct type is "image/vnd.microsoft.icon". More reading:
http://en.wikipedia.org/wiki/ICO_(file_format)#MIME_type


RE: favicon content type - Joel - 11-22-2011 10:32 AM

(11-17-2011 11:13 AM)pmeenan Wrote:  You should be able to add

Code:
<IfModule mod_mime.c>
    AddType image/ico .ico
</IfModule>

to get Apache to set the correct mime type for the favicon.

it didn't do the job, no idea why (worked on a test site though), and why is it served as wrong file type in first place?


RE: favicon content type - Joel - 11-29-2011 04:38 AM

whats interesting here is that when I add the <IfModule mod_mime.c> in a .htaccess of a subfolder it does work (but I don't want to work with htaccess on subfolders)
any idea? does it matter in which order it's entered in the .htaccess file? on the subfolder I had only this one line
Code:
<IfModule mod_mime.c>
    AddType image/ico .ico
</IfModule>
so maybe other parts of the htaccess is conflicting this one?


RE: favicon content type - Joel - 01-12-2012 07:41 AM

We moved to a different hosting (for other reasons) and the favicon is now fine!


RE: favicon content type - allogarage - 01-15-2012 03:31 AM

(11-22-2011 07:02 AM)laboot Wrote:  Google uses: "Content-Type: image/x-icon". Me too.

While correct type is "image/vnd.microsoft.icon". More reading:
http://en.wikipedia.org/wiki/ICO_(file_format)#MIME_type

+1 for Content-Type: image/x-icon