Opened 5 years ago

Closed 5 years ago

#1485375 closed Feature Requests (fixed)

place favicon.ico into the root

Reported by: tensor Owned by:
Priority: 5 Milestone: 0.2-stable
Component: PHP backend Version: 0.2-beta
Severity: trivial Keywords:
Cc:

Description

Some browsers query for favicon.ico regardless of the <link> element. Placing favicon.ico will reduce the amount of "not found" error messages in apache error log.

Change History (7)

comment:1 Changed 5 years ago by Lazlo

  • Version changed from 0.2-alpha to 0.2-beta

comment:2 Changed 5 years ago by Lazlo

The favicon is template specific, so it should stay in the skin folder. But you can add a redirect in the root .htaccess from /favicon.ico to the favicon in the skin folder.

comment:3 Changed 5 years ago by tensor

One notorious browser is Opera. All "normal" browsers will take the icon from the <link> element. And Opera too, I think, will pick up the icon from the <link> element, as soon as it sees it. I belive it queries blindly for /favicon.ico before it sees (parses) the favicon.ico in the <link>.

A default .htcaccess may include a redirect to the default skin.

comment:4 Changed 5 years ago by tensor

Something like this

=== .htaccess
==================================================================
--- .htaccess   (revision 1974)
+++ .htaccess   (local)
@@ -19,5 +19,9 @@
   Deny from all
 </FilesMatch>
 
+<IfModule mod_alias.c>
+  Redirect /favicon.ico /skins/default/images/favicon.ico
+</IfModule>
+
 Order deny,allow
 Allow from all

}}

comment:5 Changed 5 years ago by alec

  • Resolution set to fixed
  • Status changed from new to closed

Applied in [e3f42750].

comment:6 Changed 5 years ago by tensor

  • Resolution fixed deleted
  • Status changed from closed to reopened

There were some complaints about this change producing 500 Internal Server Error.
The problem is that Apache 2.0 and lower requires the full URI with scheme in the second argument to the Redirect directive.

Something like this should work even in Apache 1.3

=== .htaccess
==================================================================
--- .htaccess   (revision 2063)
+++ .htaccess   (local)
@@ -23,8 +23,10 @@
   Deny from all
 </FilesMatch>
 
-<IfModule mod_alias.c>
-  Redirect /favicon.ico /skins/default/images/favicon.ico
+# prevent browsers ignoring <link rel="icon" ... /> to spam the error log
+<IfModule mod_rewrite.c>
+RewriteEngine On
+RewriteRule ^favicon.ico$ skins/default/images/favicon.ico
 </IfModule>
 
 Order deny,allow

comment:7 Changed 5 years ago by alec

  • Component changed from Other to PHP backend
  • Resolution set to fixed
  • Status changed from reopened to closed

Fixed in [34942eb1].

Note: See TracTickets for help on using tickets.