我有一个网站 example.com,其中有许多可以发表评论的页面。我没有使用提交/回发将评论发布回服务器,而是使用 Ajax,但它似乎创建了额外的页面。
http://example.com/page
http://example.com/page/postcomment
它索引了postcomment 页面,而不是没有postcomment 的页面。如何防止 Google 索引回发函数调用?下面是我为提交评论而调用的 Jquery/Ajax 函数以及 Google 随后将要索引的内容。
$.ajax({ type: "POST", url: '/page/postcomment', dataType: "json",
data: data, contentType: "application/json; charset=utf-8",
success: function () { alert('Thanks for commenting, it will be reviewed and uploaded later.'); },
error: function (response) { alert(response.statusText); } }); } } });