关于如何在ASP中提供favicon.ico,最终/最好的建议是什么?净MVC吗?
我目前正在做以下事情:
在RegisterRoutes方法的最开始添加一个条目: routes.IgnoreRoute (ico“位于”); 将favicon.ico放在我的应用程序的根目录中(这也将是我的域的根目录)。
我有两个问题:
Is there no way to put the favicon.ico somewhere other than the root of my application. It's pretty icky being right there at the same level as Content and Controllers. Is this IgnoreRoute("favicon.ico") statement sufficient - or should I also do the following as discussed in a blog post from Phil Haack. I'm not aware of ever having seen a request to favicon.ico in any directory other than the root - which would make this unnecessary (but it's good to know how to do it). routes.IgnoreRoute("{*favicon}", new {favicon=@"(.*/)?favicon.ico(/.*)?"});