使用jquery为用户而不是机器人生成链接安全吗?
例如:我有一个产品列表页面,从不同的产品详细信息页面正确链接。产品详细信息页面可能会以以下方式显示一个突出显示的功能:www.site.com/product3?highlight_feature=3
现在,对于产品列表页的每个列表项,我想将所有不同的功能链接添加到产品页,例如。
PRODUCT LIST PAGE
**Product 1** (`www.site.com/product1)
feature1 (www.site.com/product1?highlight_feature=1)
feature2 (www.site.com/product1?highlight_feature=2)
...我正在考虑对外部链接使用相同的技术,以避免机器人退出我的网站。搜索引擎优化安全吗?如果是这样,我如何才能做到这一点呢?
我测试的东西如下:
$(.myLink).live('click', function(e){
window.location = ... uri;
});谢谢
发布于 2012-12-22 23:28:15
如果您想阻止这些功能URL,您可以使用robots.txt:
User-agent: *
Disallow: highlight_feature这将阻止URL,如:
example.com/product1?highlight_feature=2example.com/product1?highlight_featureexample.com/highlight_feature=3example.com/foo/bar/highlight_feature/foo/bar和/或您可以使用rel值canonical
对于URL,添加以下link元素:
<link rel="canonical" href="http://example.com/product1" />但是,只有在两个页面的内容几乎相同的情况下才应该使用canonical,例如,当突出显示功能实际上只“突出显示”一个功能时。
发布于 2012-12-22 04:09:05
这就是canonical标记的用途。
发布于 2012-12-22 04:09:58
我会添加一个robots.txt,告诉机器人不要使用这些链接。它看起来像这样:
User-agent: *
Disallow: /products/https://stackoverflow.com/questions/13996544
复制相似问题