I’ve got a controller that will respond to /favicon.ico appropriately.
But I just realized that when you’re in a sub page such as /subpage/index.html the browser (at least chrome) is requesting /subpage/favicon.ico.
Is there a clean way to just respond to all favicon.ico requests? I’d rather not redirect all .ico requests if possible, but if that’s the best solution, perhaps.
Ok, one option I just finagled out of my fingers using the controller:
Note the need to use the file name fav.ico, if you try this using file name favicon.ico you’ll get an infinite loop.
I previously was using this approach for just
@RequestMapping("favicon.ico")And this assumes you’re serving static content out of
/publicwith something like this: