Get rid of favicon.ico 404 errors with rails

Every time your browser loads an new url, it also request a file
called ‘favicon.ico’ in the same subdirectory. This generates a LOT of
errors in the Ruby on Rails logs of my app.

One way to avoid those errors is to redirect the browser to the root /favicon.ico file.

Just add this line in the /public/.htaccess file of your rails project :

 RewriteRule ^(.*)favicon.ico$ favicon.ico [QSA]

Do you use another method to resolve this problem ?


Tags :
Categories : Software, Ruby on Rails

Comments

comments powered by Disqus
Copyright © 2000-2022 - Eric Abouaf