I have copied my favicon.ico file to my Apache document root. I had to add an Apache Rewrite exception for it and now it is accessible from www.example.com/favicon.ico. Bu
favicon icon behaves differently for different browswrs & sometimes if it works in FF & does not work in IE. Try after Clearing the cache of the browser and standard code for favicon ico is, Just put below tag in your index file OR whichever common file for your project.
Although new browsers support GIF and PNG images , but , I would suggest always saving the image as favicon.ico.