在這樣的頁面:https://medstro.com/groups/nejm-group-open-forum/discussions/61爲什麼Googlebot會從僅限JSON的網址請求HTML?
我有這樣的代碼:
$.getJSON("/newsfeeds/61?order=activity&type=discussion", function(response) {
$(".discussion-post-stream").replaceWith($(response.newsfeed_html));
$(".stream-posts").before($("<div class=\'newsfeed-sorting-panel generic-12\' data-id=\'61\'>\n<div class=\'newsfeed-type-menu generic-12\'>\n<ul class=\'newsfeed-sorting-buttons\'>\n<li>\n<span>\nShow\n<\/span>\n<\/li>\n<li>\n<select id=\"type\" name=\"type\"><option selected=\"selected\" value=\"discussion\">Show All (15)<\/option>\n<option value=\"discussion_answered\">Answered Questions (15)<\/option>\n<option value=\"discussion_unanswered\">Unanswered Questions (0)<\/option><\/select>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n"));
Newsfeed.prepare_for_newsfeed_sort($(".newsfeed-sorting-panel"));
});
Googlebot的決定,它想看看是否有在/newsfeeds/61?order=activity&type=discussion
任何有趣的HTML。所以它會嘗試抓取那個請求HTML的URL,並且我的應用報告一個錯誤。 「ActionView :: MissingTemplate:Missing template newsfeeds/show ...」
- 爲什麼Googlebot試圖抓取此URL?僅僅因爲它認爲有機會有一些有趣的東西,它試圖抓取所有東西?還是因爲我的代碼有問題?
- 在Rails中處理這個問題的最好方法是什麼?我不想忽略所有MissingTemplate錯誤,因爲可能有些情況會在事件中發出真正錯誤的信號。同樣的事情,忽略機器人創建的錯誤。我有其他選擇嗎?
不,它僅適用於GSA:http://webmasters.stackexchange.com/questions/54735 /罐您使用-googleon-和googleoff-評論對防止-的Googlebot從索引-p – Quentin