log-madness with favicon.ico

it is a well-known problem that some old Microsoft Internet Explorers look for the favicon.ico, no matter it is present or not. modern browsers look for a related link to this icon in the header of the website. the problem is, that such requests and additionally the requests for robots.txt spam the error-logs.

the solutions handgestrickt found on the web did not really satisfy us, because of the fact that we always have to place some rules for every virtual host. we wanted a directive for every virtual host. additionally we had to take care of the fact, that for some virtual hosts the files exist. so a 404 for these requests would be wrong.

our solution is based on SuSE 9.3 with Plesk 8. so for your setups you should change some lines:

#place this file in /etc/apache2/conf.d and restart
#apache. gets rid of the annoying 404 entries in the
#error_log if favicon.ico or robots.txt are not present
<DirectoryMatch /srv/www/vhosts/([^/]*)/https?docs>
        RewriteEngine On
        RewriteBase /
        RewriteCond %{REQUEST_URI} ^/(favicon\.ico|robots\.txt)
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ /error/HTTP_NOT_FOUND.html.var [L]
</DirectoryMatch>

bye bye log-spam! one forum post that really made us laugh out loud suggested the following:

RedirectMatch permanent .*/favicon\.ico$ http://www.microsoft.com/favicon.ico/requests/areflooding/my/error/log

this entry redirects all favicon-requests to Microsoft and spams their logs. another way of justice!

Wednesday, 07. March 2007 • trackback url

Re: log-madness with favicon.ico

You could have a favicon.ico entered to decorate peoples browser & and have a robots.txt file on your site.Problem solved. doh!
ps Love the spoken captcha ;)

Reply

Friday, 16. March 2007 • Nick • • wwwReply

trackback url

Re: log-madness with favicon.ico

hello Nick,

the problem is, i cannot add favicon.ico and robots.txt for all the customers on the machine. i have no time adding this for 100 customers. ;-)

anyway i like to hear that you like the captcha!

Reply

Saturday, 17. March 2007 • Stefan Jelner • @wwwReply

trackback url

Add Comment

( to reply to a comment, click the reply link next to the comment )

Comment Title:
Your Name:
Email Address:
Make Public?
Website:
Make Public?

Comment:


Allowed XHTML tags : a, b, i, strong, code, acrynom, blockquote, abbr. Linebreaks will be converted automatically.


Captcha:

captcha image

please type the content of the above image into the following form-field: