Results 1 to 11 of 11
  1. #1

    File does not exit: Favicon.ico

    Hello,

    I use Wordpress and I serve my favicon as png with link tag.

    HTML Code:
    <link href="/wp-content/themes/example/images/favicon.png" rel="icon" type="image/vnd.microsoft.icon"/>
    But I still see an error in error_log about favicon.
    Code:
    [Sat Aug 16 09:54:09 2014] [error] [client **.**.***.***] File does not exist: /var/www/vhosts/example.com/httpdocs/favicon.ico
    What is the actual cause of this error please? And how can I prevent it if possible?

    Thanks.

  2. #2
    Join Date
    Aug 2001
    Posts
    5,597
    First of all, your mime type does not match the actual file.

    Second, these requests come from clients which still expect to download it from the root directory. You could simply have a symlink.

  3. #3
    Quote Originally Posted by zoid View Post
    First of all, your mime type does not match the actual file.

    Second, these requests come from clients which still expect to download it from the root directory. You could simply have a symlink.
    Thank you so much for your reply.

    Thanks also for the warning. I am not sure why I placed "image/vnd.microsoft.icon". I recall that it was necessary to include image/vnd.microsoft.icon for Internet Explorer but I am not sure. Should it be image/png?

    How can I create the symlink? Also can symlinking ICO to PNG create any issues?

    Thanks

  4. #4
    Join Date
    Aug 2001
    Posts
    5,597
    For a PNG file, this would be the appropriate mime type. However you are right, simply symlinking the icon file to the PNG file might easily "confuse" a client. You can also simply copy an ICO counterpart in the root directory.

  5. #5
    Quote Originally Posted by zoid View Post
    For a PNG file, this would be the appropriate mime type. However you are right, simply symlinking the icon file to the PNG file might easily "confuse" a client. You can also simply copy an ICO counterpart in the root directory.
    Thanks again.

    I changed mime/type and placed a favicon.ico in root directory.

    Now the error is gone in error_log but when I view the favicon.ico by Google Chrome, it downloads the file rather than showing.

    But when I view google.com/favicon.ico by Chrome, it shows the image.

    How can I make my favicon.ico to display rather than download?

    Thanks

  6. #6
    Join Date
    Aug 2001
    Posts
    5,597
    Most likely a header issue (random guess, mime type for ICO files). Check the headers of your site and compare them to Google.

  7. #7
    Quote Originally Posted by zoid View Post
    Most likely a header issue (random guess, mime type for ICO files). Check the headers of your site and compare them to Google.
    Thanks again.

    Yes, it is served as text/plain.

    I searched hosting company documentation. They recommend adding mime type for .htaccess file. I am not sure it is good idea to change .htaccess file just for one ICO file.

    Also mime/types are available in /etc/mime.types file. Which file (htaccess or mime.types) does consume less resource when adding mime/types?

    Thanks

  8. #8
    Join Date
    Aug 2001
    Posts
    5,597
    mime.types is for the system itself. In your case you should either edit the Apache configuration or the htaccess. The latter might have theoretically a tiny performance drawback compared to the former, but as you seem to already have it in place it wouldnt matter anyhow.

  9. #9
    Join Date
    Jan 2014
    Posts
    35
    first upload .ico file to your server then add complete url in header section.

  10. #10
    Quote Originally Posted by zoid View Post
    mime.types is for the system itself. In your case you should either edit the Apache configuration or the htaccess. The latter might have theoretically a tiny performance drawback compared to the former, but as you seem to already have it in place it wouldnt matter anyhow.
    Thanks again.

    I checked httpd.conf and .htaccess file in my root folder but there are no AddType for ico files. But my server still servers ico files as text/plain. Is this default behavior or some other configuration file is interfering?

    Thanks.

  11. #11
    Join Date
    Aug 2001
    Posts
    5,597
    The mime type is not really an issue in this case anyhow. But should it still bother you, just add the desired mime type to the Apache configuration. But again, for this particular case it doesnt really matter. The browser will display whatever it finds under the given filename and might even display correctly regardless of the file extension.

Similar Threads

  1. HELP : About favicon.ico
    By iamglennmar in forum Web Design and Content
    Replies: 3
    Last Post: 03-10-2011, 08:49 PM
  2. Using favicon.ico?
    By Goldfiles in forum Web Design and Content
    Replies: 7
    Last Post: 06-03-2008, 01:25 PM
  3. What does this mean? Favicon.ico
    By fjiwa in forum Web Hosting Lounge
    Replies: 16
    Last Post: 09-09-2003, 08:43 AM
  4. Favicon.ico
    By Axi in forum Web Hosting Lounge
    Replies: 8
    Last Post: 09-08-2003, 01:38 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •