几招让你的网站免受采集之苦
来源:
互联网
日期:2008-4-24
如今的采集系统是一个比一个NB,站长们辛苦收集制作的网站内容总是很快出现在在另一个网站上,一个网站轻易的就被复制了又复制。有办法既不影响搜索引擎的正常收入又能解决网站被采集之苦么?答案是肯定的。
最常用的防采集方法:
1.每个文章的命名不要有任何规律,比如你的文章是<%=id%>.htm的话,请在前面或后面生成个日期,如:20070911-1234.htm,前面的就是日期了,这样对采集新手来说是非常有效的。
2.不要把所有的文章都放在一个目录下,你可以利用日期生成不同的目录名。
3.不要所有的文章都用一个模板,制作尽量多的模板,添文章的时候可有选要用哪个模板,一般采集者的采集程序是有针对性的,他在采集前会对你的页面进行分析,如果你所有的页面排版无规律可寻,那么我想他就会放弃了。
以上三种方法能防住初级采集的,但是对高手来说没什么用。 下面三种方法用限制采集人的IP或SESSION的方法来达到防采集的目的。
方法一:(ASP代码):
以下为引用的内容: <% Dim AppealNum,AppealCount AppealNum=10 '同一IP60秒内请求限制10次 AppealCount=Request.Cookies("AppealCount") If AppealCount="" Then response.Cookies("AppealCount")=1 AppealCount=1 response.cookies("AppealCount").expires=dateadd("s",60,now()) Else response.Cookies("AppealCount")=AppealCount+1 response.cookies("AppealCount").expires=dateadd("s",60,now()) End If if int(AppealCount)>int(AppealNum) then response.write "飞腾设计网 http://www.feitec.com 提醒您:抓取很累,歇一会儿吧!" response.end End If %> |
第二种方法(ASP):
以下为引用的内容: <% user_agent=Request.ServerVariables("HTTP_USER_AGENT") http_reffer=Request.ServerVariables("HTTP_REFERER") server_name=Request.ServerVariables("SERVER_NAME") '检查当前用户是否是蜘蛛人 function check(user_agent) allow_agent=split("Baiduspider,Scooter,ia_archiver,Googlebot,FAST-WebCrawler,MSNBOT,Slurp",",") check_agent=false for agenti=lbound(allow_agent) to ubound(allow_agent) if instr(user_agent,allow_agent(agenti))>0 then check_agent=true exit for end if next check=check_agent end function if check(user_agent)=False then if http_reffer="" or left(http_reffer,len("http://"&server_name)+1)<>"http://"&server_name&"/" then %> <html><body> <form action='' name=checkrefer id=checkrefer method=post> </form> <script> document.all.checkrefer.action=document.URL; document.all.checkrefer.submit(); </script> </body></html> <%response.end end if end if %> |
更多的几招让你的网站免受采集之苦请到论坛查看: http://BBS.TC711.COM
【 双击滚屏 】 【 评论 】 【 收藏 】 【 打印 】 【 关闭 】
来源:
互联网
日期:2008-4-24
|
|
|