我有一个网站example.com,我有一些网页可以发表评论。我使用Ajax,而不是使用submit/postback将注释发回服务器,但它似乎创建了额外的页面。防止谷歌索引回传阿贾克斯目的地
http://example.com/page
http://example.com/page/postcomment
它编制了postcomment页面的索引而不是没有postcomment的页面。我怎样才能防止谷歌索引回传函数调用?下面是我调用来提交评论的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); } }); } } });
[网络管理员问题SE](http://webmasters.stackexchange.com/q/101763/17633) – unor
我投票结束这个问题作为题外话,因为它是关于谷歌索引,而不是编码。这已经被交叉发布到网站管理员StackExchange,这是此问题的正确位置。 –
把这个问题放在两种情况下,以防有编码解决方案,但下面的答案似乎有伎俩。 Google Robot.txt似乎接受它。 – MiscellaneousUser