You should use POST for actions which change things as search engine usually do not submit forms. Additionally, this will prevent users who download your website recursively (e.g. with wget) from submitting tons of votes.
Depending on your site, handling voting though javascript might be a solution, too.
Regarding your robots.txt: It has to be in the root path - i.e. http://www.thesite.com/robots.txt - and if your rating system is at /blah/rate you need to use Disallow: /blah/rate instead of Disallow: /rate
发布评论
评论(3)
您应该使用 POST 来执行更改操作,因为搜索引擎通常不提交表单。此外,这将阻止递归下载您的网站(例如使用 wget)的用户提交大量投票。
根据您的站点,通过 JavaScript 处理投票也可能是一种解决方案。
关于您的 robots.txt:
它必须位于根路径中 - 即 http://www.thesite.com/robots.txt - 如果您的评级系统为 /blah/rate,则需要使用
Disallow: /blah/rate
而不是Disallow: /rate
You should use POST for actions which change things as search engine usually do not submit forms. Additionally, this will prevent users who download your website recursively (e.g. with wget) from submitting tons of votes.
Depending on your site, handling voting though javascript might be a solution, too.
Regarding your robots.txt:
It has to be in the root path - i.e. http://www.thesite.com/robots.txt - and if your rating system is at /blah/rate you need to use
Disallow: /blah/rate
instead ofDisallow: /rate
对我来说看起来不正确。您只是禁止访问
http://www.thesite.com/rate
(及其下面的页面 IIRC)。另外,一些爬虫会忽略robots.txt
!最好使评级仅根据 POST(而不是 GET)响应而改变。搜索引擎从不使用POST。
Looks incorrect to me. You're only disallowing access to
http://www.thesite.com/rate
(and pages below it IIRC). Plus some crawlers ignorerobots.txt
!Better to make it so that ratings are only ever altered in response to a POST, rather than a GET. Search engines never use POST.
您必须使用完整路径。
可能想在这里阅读一下: http://www.javascriptkit.com/howto/robots .shtml
You have to use the full path.
Might want to read up here a bit: http://www.javascriptkit.com/howto/robots.shtml