That is not its canonical place, but since we are using rewrite rules you can (tweaking the right-side in the examples I sent before). You can leave them under public if you want as well.
As you know favicon.ico is normally requested by browsers automatically. That is, you don't link to it, except perhaps by a LINK element like this one in the HEAD of your layout:
<!-- following the guidelines in Favicon - Wikipedia -->
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
Now, if I understand the setup correctly you have two vhosts pointing to the same Rails application. In particular they share the public directory which is the root of the problem.
respectively when they visit any page on those websites.
The point is that you don't even have a favicon.ico under public. You instead have two different .icos somewhere under public and have rewrite rules fool the browser. Each vhost has a different rewrite rule that rewrites internally the URL to serve its corresponding .ico. Perhaps you are not used to this stuff, the browser won't know it is getting something called some other thing in the filsystem of the server, nor that the URL was mangled, /favicon.ico will be retrieved as if existed.
With this setup both .icos are _available_ using direct URLs since the document root is shared, but only the corresponding one will be served as /favicon.ico, which is what we want.