﻿{"id":728,"date":"2012-02-07T11:35:48","date_gmt":"2012-02-07T03:35:48","guid":{"rendered":"http:\/\/nick.workao.org\/?p=728"},"modified":"2012-02-07T11:35:48","modified_gmt":"2012-02-07T03:35:48","slug":"%e8%bd%ac%e7%a6%81%e6%ad%a2%e7%88%ac%e8%99%ab%e8%ae%bf%e9%97%ae%e6%8a%80%e5%b7%a7","status":"publish","type":"post","link":"https:\/\/nick.txtcc.com\/index.php\/linux\/728","title":{"rendered":"[\u8f6c]\u7981\u6b62\u722c\u866b\u8bbf\u95ee\u6280\u5de7"},"content":{"rendered":"<div>\n\n\u6709\u65f6\u5019\uff0c\u4e00\u4e9b\u79d8\u5bc6\u7684\u5165\u53e3\uff0c\u4e00\u4e9b\u88ab\u722c\u866b\u722c\u8fc7\u4fbf\u6709\u66b4\u9732\u98ce\u9669\u7684\u76ee\u5f55\uff0c\u6211\u4eec\u5fc5\u987b\u91c7\u7528\u4e00\u5207\u624b\u6bb5\u6765\u4fdd\u536b\u3002\u7981\u6b62\u4e00\u5207\u722c\u866b\u8fdb\u5165\uff0c\u5c3d\u7ba1\u79f0\u4e0d\u4e0a\u5b8c\u5168\u4fdd\u5bc6\uff0c\u4f46\u57fa\u672c\u4e0a\u53ef\u4ee5\u628a\u79d8\u5bc6\u7684\u4f20\u64ad\u53d8\u5f97\u53ef\u63a7\u3002\n\n1.robots.txt\n\n\u5728\u60f3\u8981\u4fdd\u5bc6\u7684\u90a3\u4e2a\u76ee\u5f55\u6216\u8005\u5165\u53e3\u7684\u6839\u76ee\u5f55\u521b\u5efarobots.txt\uff0c\u7136\u540e\u5728\u91cc\u9762\u52a0\u5165\u4ee5\u4e0b\u5185\u5bb9\uff0c\u5219\u542c\u8bdd\u7684\u722c\u866b\u5982Google\u722c\u866b\u5728\u6293\u5230\u4f60\u7684\u7f51\u7ad9\u7684\u65f6\u5019\u5c31\u4f1a\u6084\u7136\u79bb\u53bb\u3002\n<blockquote>User-Agent: *\nDisallow: \/<\/blockquote>\n2.htaccess\n\n\u7531\u4e8e\u5e76\u4e0d\u662f\u6240\u6709\u641c\u7d22\u5f15\u64ce\u90fd\u50cfGoogle\u90a3\u6837Do No Evil\uff0c\u6240\u4ee5\u5e76\u4e0d\u662f\u6240\u6709\u722c\u866b\u90fd\u50cfGoogle\u722c\u866b\u90a3\u6837\u542c\u8bdd\u7684\u9075\u5faaRobots.txt\u91cc\u7684\u63cf\u8ff0\uff0c\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u9700\u8981\u7528\u5230htaccess\u6765\u5f3a\u5236\u5c4f\u853d\u90a3\u4e9b\u6076 \u5fc3\u7684\u574f\u722c\u866b\u4eec\u7684\u8bbf\u95ee\uff0c\u8fd9\u79cd\u5c4f\u853d\u662f\u76f4\u63a5\u7684\u5c4f\u853d\u3002\u6211\u4eec\u53ef\u4ee5\u5728\u8981\u4fdd\u5bc6\u7684\u90a3\u4e2a\u76ee\u5f55\u6216\u8005\u5165\u53e3\u7684\u6839\u76ee\u5f55\u7684.htaccess\u6587\u4ef6\u4e2d\u52a0\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a\n<blockquote>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Bot\\ mailto:craftbot@yahoo.com [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Download\\ Demon [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Express\\ WebPictures [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^HMView [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Image\\ Stripper [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Image\\ Sucker [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} Indy\\ Library [NC,OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Internet\\ Ninja [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^JOC\\ Web\\ Spider [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^larbin [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Mass\\ Downloader [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^MIDown\\ tool [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Mister\\ PiX [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Net\\ Vampire [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Offline\\ Explorer [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Offline\\ Navigator [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Papa\\ Foto [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Teleport\\ Pro [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Web\\ Image\\ Collector [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Web\\ Sucker [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^WebGo\\ IS [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Website\\ eXtractor [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Website\\ Quester [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Xaldon\\ WebSpider [OR]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^Zeus [or]<\/h6>\n<h6>RewriteCond %{HTTP_USER_AGENT} ^BaiduSpider<\/h6>\n<h6>RewriteRule ^.* \u2013 [F,L]<\/h6>\n\u00a0\n\nnginx \u7528 if \u548c $http_user_agent\u3002\n\n\u5982:\n<div>\n<ol start=\"1\">\n    <li>location\u00a0\/\u00a0{<\/li>\n    <li>\u00a0\u00a0\u00a0\u00a0root\u00a0\u00a0\u00a0\/home\/www\/;<\/li>\n    <li>\n    <li>\u00a0\u00a0\u00a0\u00a0if\u00a0($http_user_agent\u00a0~*\u00a0&#8220;qihoobot&#8221;)\u00a0{<\/li>\n    <li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return\u00a0403;<\/li>\n    <li>\u00a0\u00a0\u00a0\u00a0}<\/li>\n    <li>\u00a0\u00a0\u00a0\u00a0#&#8230;<\/li>\n    <li>}<\/li>\n<\/ol>\n<\/div>\n<pre>location \/ {\n    root   \/home\/www\/;\n\n    if ($http_user_agent ~* \"qihoobot\") {\n        return 403;\n    }\n    #...\n}<\/pre>\n\u7136\u540e\u91cd\u542f nginx<\/blockquote>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>\u6709\u65f6\u5019\uff0c\u4e00\u4e9b\u79d8\u5bc6\u7684\u5165\u53e3\uff0c\u4e00\u4e9b\u88ab\u722c\u866b\u722c\u8fc7\u4fbf\u6709\u66b4\u9732\u98ce\u9669\u7684\u76ee\u5f55\uff0c\u6211\u4eec\u5fc5\u987b\u91c7\u7528\u4e00\u5207\u624b\u6bb5\u6765\u4fdd\u536b\u3002\u7981\u6b62\u4e00\u5207\u722c\u866b\u8fdb\u5165\uff0c\u5c3d\u7ba1\u79f0\u4e0d\u4e0a\u5b8c\u5168\u4fdd\u5bc6\uff0c\u4f46\u57fa\u672c\u4e0a\u53ef\u4ee5\u628a\u79d8\u5bc6\u7684\u4f20\u64ad\u53d8\u5f97\u53ef\u63a7\u3002 1.robots.txt \u5728\u60f3\u8981\u4fdd\u5bc6\u7684\u90a3&#46;&#46;&#46;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-728","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/comments?post=728"}],"version-history":[{"count":2,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/728\/revisions"}],"predecessor-version":[{"id":730,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/728\/revisions\/730"}],"wp:attachment":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/media?parent=728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/categories?post=728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/tags?post=728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}