Googlebot receiving missing template error for an existing template

后端 未结 4 1308
甜味超标
甜味超标 2021-02-01 19:56

In the last couple of days, we have started to receive a missing template error when the google bot attempts to access our main home page (welcome/index). I have been staring at

4条回答
  •  醉梦人生
    2021-02-01 20:46

    I am also getting the same, I did some investigation and came to the conclusion it is a 'bug' in Rails. */*;q=0.9 is the value of the HTTP accept parameter. I'm not exactly sure what is going on, but in Rails 3.0 this works. In Rails 3.1 it returns a 500 response, and in Rails 3.2 it returns a 406 response.

    Update:

    There is an open bug regarding this issue. One workaround is to set this new option in Rails 3.1:

    config.action_dispatch.ignore_accept_header = true
    

    However... if you serve any pages other than HTML you'll need to rely on the extension to denote the type (e.g. /users/1.json) instead of accept headers.

提交回复
热议问题