Problem/Motivation
This is a followup to #174940: Root /favicon.ico accounts for majority of 'Page not found' errors. After that was committed work continued there and it was difficult to determine what needed to be fixed. Thus this new issue. It is worth reading the comments after that was first marked fixed, which being at #69.
The solution in that issue was to add favicon to the .htaccess rewrite rules like this:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]This effectively means that Apache won't run PHP and therefore no Drupal bootstrap happens. Apache handles the request itself. However, what that means is that Apache's own error log will be filled with entries about a missing 'favicon.ico' file.
Steps to reproduce
Proposed resolution
Remaining tasks
Reminder to add credit from the #174940: Root /favicon.ico accounts for majority of 'Page not found' errors
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | favicon404-174940-92.patch | 906 bytes | quietone |
Comments
Comment #2
quietone commentedThis is the latest patch from the other issue.
Still need to add credit and move relevant comments over to here.
Comment #3
quietone commentedComment #4
a.ross commentedI don't think that patch does anything. Apache produces the 404 itself.
My suggestion was to just add a dummy favicon.ico to the webroot: https://gist.github.com/ameenross/2cc35daa45b5b3e2fe840ddcce95523b
It could be done by a script or something to allow for people to remove or replace it if they feel like it. That way it won't be overwritten by a Drupal update.
FWIW, I've done something similar in the past for recurring 404's on URLs like
apple-touch-icon.png. Solution, the following console command:$ touch apple-touch-icon.png. Never had any complaints.Comment #5
jwilson3Here is the way to suppress 404 errors from apache error logs, but have them still show up in access logs: