Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

favicon.ico not found error?

I have an application that uses Spring Security 3 runs on Tomcat. I didn't define any favicon for my website however when I run my application from my IDE sometimes after I login from my login pages it redirects my page to:

http://localhost:8080/favicon.ico

and says:

404 Not Found

There is a topic here: http://forum.springsource.org/showthread.php?100901-redirect-to-favicon.ico however I didn't define a favicon.ico does Spring Security 3 wants it by default(if yes, why it happens sometimes?)

like image 811
kamaci Avatar asked Sep 14 '11 08:09

kamaci


People also ask

How do I fix favicon ICO?

In my case, it was fixed by moving the favicon. ico to the same place as my Html file. Obviously, you should change the icon path too.

What is favicon ico not found?

If there is no favicon. ico file at the root level of a website, when a webpage is bookmarked a 404 (file not found) error may be generated (depending on the browser used). This error will not be visible to the user, but will be shown in the website server log (traffic report).

What is the file favicon ICO?

The favicon. ico is a small icon found in the URL address bar and on bookmarks created by web browsers. For example, in the image above, there's a small icon ( ) in the front of the Computer Hope URL.


1 Answers

Here is the explanation:

The issue is, when the browser cache is empty and a user comes in, here is what happens:

  • the user requests URL "/". This URL is cached.
  • the browser makes a requests to "/favicon.ico". This URL becomes the new URL where to redirect to upon authentication.
  • the user posts the login form and is redirected to "/favicon.ico".

To fix this, you need to set "/favicon.ico" as being a non-secured resources:

<intercept-url pattern="/favicon.ico" access="ROLE_ANONYMOUS" />

Taken from: http://blog.idm.fr/2010/09/spring-security-redirecting-to-faviconico.html

like image 135
kamaci Avatar answered Oct 03 '22 17:10

kamaci