if I don't change the default favicon on my theme, the path to http://mydomain.com/favicon.ico returns a 404 error

Comments

mannos’s picture

The favicon.ico is in the 'misc' folder by default; add that to your path and you'll see it. To add your own, try 'shortcut icon settings' on the settings page for your theme.

defigo’s picture

I have had this issue for a while and found that if you changed the name of the ico file and then assign the path in your settings it does work

For example I changed favicon.ico to example.ico

kbobash’s picture

Bingo! Thank you @defigo, this is the only thing that worked for me...seems like a bug to me!

My setup is D7.16, multi-site, IIS 7.5, MS-SQL Server database
BTW, the path to my favicon is in the /sites/my-site-name/files folder

I used the file upload UI in the theme's settings page, but until I changed the name from favicon.ico to favicon2.ico, it still couldn't find the favicon!

When I had the favicon set to be favicon.ico, I looked in the variable table in the database for my theme's settings, and it had a null string for the path. After changing the theme's settings and uploading the favicon2.ico file, the variable was then set to "public://favicon2.ico".

johnennew’s picture

Status: Active » Needs review
StatusFileSize
new3.53 KB

This module should use the misc/favicon.ico file if nothing else is set. Patch attached.

This fixes some coding standards and tests as well.

johnennew’s picture

Status: Needs review » Fixed

Committed to 7.x-1.x branch

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jwilson3’s picture

This module should use the misc/favicon.ico file if nothing else is set.

The patch that was committed here doesn't do enough to work when you have placed a favicon.ico in your theme without using the Theme UI to upload a file (or specified the path to the favicon file).

Drupal core is smart enough to test whether the favicon.ico file exists in a theme when toggle_favicon = 1 and default_favicon = 1, but it specifically does not set the favicon_path variable. it only sets a 'favicon' variable instead, and this module needs to be doing the same.

I'm going to open a follow-up issue for this.