I had this problem with Firefox too.
On my website the favicon on http://mywebsite.comhttp://example.com
worked
fine but not on http://www.mywesite.comhttp://www.example.com
.
I fixed it by hardcoding the favicon.
<link rel='shortcut icon' type='image/x-icon' href='http://mywebsite.com/favicon.ico'>
<link rel='shortcut icon' type='image/x-icon' href='http://example.com/favicon.ico'>