Why am I getting error for apple-touch-icon-precomposed.png

后端 未结 11 1800
梦谈多话
梦谈多话 2020-11-29 16:06

I have created a new rails3 project but I am seeing following logs many times in my server logs. Why I am getting these request and how can I avoid these?

11条回答
  •  迷失自我
    2020-11-29 16:28

    If you don't care about the icon looking pretty on all sort of Apple devices, just add

    get '/:apple_touch_icon' => redirect('/icon.png'), constraints: { apple_touch_icon: /apple-touch-icon(-\d+x\d+)?(-precomposed)?\.png/ }

    to your config/routes.rb file and some icon.png to your public directory. Redirecting to 404.html instead of icon.png works too.

提交回复
热议问题