2

I have a file named

favicon.ico

in the web-app folder (grails 2.2.1).

My app is configured to run as root app /

If I open the url

http://mydomain/favicon.ico

I got a not 404 not found.

If I try to move the file in any subfolder it works. For example if I move it to

web-app/test/favicon.ico

and I open

http://mydomain/favicon.ico

the file is correctly served.

The problem is the same if I run the app with grails run-app

tim_yates
  • 167,322
  • 27
  • 342
  • 338
Fabiano Taioli
  • 5,270
  • 1
  • 35
  • 49

1 Answers1

1

You can configure in the Config.groovy to process resources in / like this: grails.resources.adhoc.patterns = ['/*','/images/*', '/css/*', '/js/*', '/plugins/*']

http://mydomain/favicon.ico

will get a 302 to: http://mydomain/static/favicon.ico

That should work, but I think its better to move your ico to /images

abertolo
  • 36
  • 3
  • Thankyou. I have solved adding favicon.ico to urlmapping exclude list. Your solution may work but I don't think that respond to every favicon request with a 302 is a smart solution. /favicon.ico is the standar browser detected location for favicon. If you don't want to use that location you have to redefine it with a metatag inside the page and I don't see any reason to do do it. – Fabiano Taioli May 17 '13 at 15:03