EllisLab text mark
Advanced Search
     
favicon.ico
Posted: 25 March 2009 01:03 PM
Joined: 2008-11-01
66 posts

I am getting tons of 404s for a missing favicon.ico (thanks Microsoft). Of course, I can;t just throw one in the root directory because of the way CI handles the framework. What is the best way to incorporate a favicon.ico in a CI site?

BTW, I tried putting it in /images which is excluded in my htaccess and then also using the <link type=ico…> html line and that didn’t work. I also added |favicon\.ico to my htaccess string and that didn’t work.

My site is generating thousands of 404s per day now and it is aggravating!

Plz help.

 
Posted: 25 March 2009 01:11 PM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2008-06-04
2101 posts

Here’s what I have in the view header.  I had to change the last parameter around to get it working (different sources suggest x-icon, image/png, etc.  Weirdage.

echo  link_tag('assets/icons/FAVICON.png''shortcut icon''image/ico'); 

Oh, and of course, yes, link_tag() is part of the HTML Helper.

 
Posted: 25 March 2009 01:21 PM   [ # 2 ]   [ Rating: 0 ]
Joined: 2008-11-01
66 posts

Thanks.

But isn’t that exactly the same as this:

<link href=”/images/favicon.ico” rel=“shortcut icon” type=“image/ico” />

which is what I have now? Or does using the helper make it integrate with CI somehow?

 
Posted: 25 March 2009 01:34 PM   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2008-06-04
2101 posts

Perhaps, but I don’t think anything is ever exactly the same.

Try using a png instead of an ico.

What are the file permissions on that file?

 
Posted: 25 March 2009 01:46 PM   [ # 4 ]   [ Rating: 0 ]
Joined: 2008-11-01
66 posts

Permissions are fine. It is also owned by the apache user. Maybe I’ll try the helper as it may set something up before it draws the HTML to allow it to work…

Thanks!

 
Posted: 27 March 2009 01:02 PM   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2008-02-04
534 posts

Why can’t you add the image to your root directory? Your mod_rewrite should not be rewriting urls to actual files on the server.