views:

159

answers:

2

I've learned that the way to add favicon for a web page is to have the following lines in the page.

<link rel="SHORTCUT ICON" type="image/x-icon" href="http://mysite.com/faviconfilename.ico"/&gt;
<link rel="icon" type="image/x-icon" href="http://mysite.com/faviconfilename.ico" />

Should i add this code in each and every page my site has?? I use Apache - tomcat clustering to serve pages. Is there any other easy way to do this?

+4  A: 

It is usually enough to place a file called "favicon.ico" in the root of your website.

klausbyskov
It worked in Safari. But not in FF. :(
tony_le_montana
It worked!!!! I just had to clear private data in FF. Thanks!
tony_le_montana
+1  A: 

Modify the apache config.

upload this file to the root directory of your website. For some reason the execute bit has to be set on this file for apache to use it. If you have shell access, type: "chmod +rx favicon.ico".

Then edit httpd.conf and insert the following line:

"AddType image/x-icon .ico"

Your approach works when you don't have access to your apache config. In this case, if you are using any framework then you should add it to your layout/template.

VP