If you’re like me, you don’t like cluttering your main folder with unnecessary files. This is why I hate that some browsers are still looking for ‘favicon.ico’ in the main folder even when you indicate in <head> that’s not where the agent should be looking…
Here is a way to eliminate those PITA 404’s from your error logs…
RewriteEngine On RewriteRule ^favicon.ico$ folder/path/favicon.ico [R=301,L]
Hope it helps 🙂
You can also use the same logic for Apple touch icons 😉
RewriteEngine On
RewriteRule ^favicon.ico$ /image/favicon/favicon.ico [R=301,L]
RewriteRule ^apple-touch-icon.png$ /image/favicon/apple-touch-icon.png [R=301,L]
Same effect without
RewriteEngine On
Redirect 301 /favicon.ico /image/favicon/favicon.ico
Redirect 301 /apple-touch-icon.png /image/favicon/apple-touch-icon.png