0

我有一个网站 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); } }); } } });
4

1 回答 1

0

我不确定它与SEO有关。如果是这样,您可以在根级别创建robots.txt 。

例如,

User-agent: * 
Disallow: /*/postcomment

仅供参考: Google 需要 24 到 48 小时才能再次索引该网站。

于 2016-12-05T14:05:48.490 回答