{"id":2124,"date":"2022-08-31T15:39:14","date_gmt":"2022-08-31T07:39:14","guid":{"rendered":"https:\/\/cn.hostease.com\/blog\/?p=2124"},"modified":"2022-08-31T15:39:14","modified_gmt":"2022-08-31T07:39:14","slug":"robots-txt%e7%9a%84%e4%bd%9c%e7%94%a8%e4%bb%a5%e5%8f%8a%e4%b8%ba%e4%bb%80%e4%b9%88%e8%af%b4%e5%ae%83%e5%be%88%e9%87%8d%e8%a6%81","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/blog\/seo\/robots-txt%e7%9a%84%e4%bd%9c%e7%94%a8%e4%bb%a5%e5%8f%8a%e4%b8%ba%e4%bb%80%e4%b9%88%e8%af%b4%e5%ae%83%e5%be%88%e9%87%8d%e8%a6%81\/","title":{"rendered":"robots.txt\u7684\u4f5c\u7528\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u8bf4\u5b83\u5f88\u91cd\u8981"},"content":{"rendered":"<p>robots.txt\u662f\u4e00\u4e2a\u7528\u4ee5\u544a\u77e5\u641c\u7d22\u5f15\u64ce\u8718\u86db\u4e0d\u8981\u6293\u53d6\u7f51\u7ad9\u67d0\u4e9b\u9875\u9762\u6216\u8005\u5185\u5bb9\u7684\u6587\u4ef6\uff0c\u7edd\u5927\u591a\u6570\u4e3b\u6d41\u7684\u641c\u7d22\u5f15\u64ce\uff0c\u5305\u62ec\u767e\u5ea6\u3001Google\u3001Bing\u548cYahoo\u90fd\u53ef\u4ee5\u8bc6\u522b\u5e76\u4e14\u5c0a\u91cdrobots.txt\u7684\u8bf7\u6c42\u3002hostease<a href=\"https:\/\/cn.hostease.com\/\" target=\"_blank\" rel=\"noopener\">\u7f8e\u56fdLinux\u4e3b\u673a\u5546<\/a>\u5206\u4eabrobots.txt\u7684\u4f5c\u7528\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u8bf4\u5b83\u5f88\u91cd\u8981<\/p>\n<p>\u5927\u591a\u6570\u7f51\u7ad9\u90fd\u4e0d\u9700\u8981robots.txt\u6587\u4ef6\uff0c\u56e0\u4e3aGoogle\u901a\u5e38\u90fd\u53ef\u4ee5\u81ea\u52a8\u627e\u5230\u5e76\u4e14\u7d22\u5f15\u7f51\u7ad9\u4e0a\u7684\u91cd\u8981\u9875\u9762\uff0c\u4ed6\u4f1a\u81ea\u52a8\u4e0d\u7d22\u5f15\u4e0d\u91cd\u8981\u7684\u9875\u9762\u6216\u5176\u4ed6\u9875\u9762\u7684\u91cd\u590d\u7248\u672c\u3002\u7531\u6b64\u53ef\u77e5\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528\u5230robots.txt\u6587\u4ef6\u7684\u4e3b\u8981\u539f\u56e0\u5927\u81f4\u6709\u5982\u4e0b\u7684\u51e0\u79cd\u60c5\u51b5\uff1a<\/p>\n<p>1.\u963b\u6b62\u975e\u516c\u5171\u9875\u9762<\/p>\n<p>\u6211\u4eec\u7684\u7f51\u7ad9\u4e0a\u96be\u514d\u6709\u6682\u65f6\u4e0d\u60f3\u88ab\u7f16\u5165\u7d22\u5f15\u7684\u9875\u9762\uff0c\u4f8b\u5982\u6b63\u5728\u7f16\u8f91\u4e2d\u7684\u9875\u9762\u6216\u8005\u767b\u5f55\u9875\u9762\uff0c\u8fd9\u4e9b\u9875\u9762\u6709\u5b58\u5728\u7684\u5fc5\u8981\uff0c\u4f46\u662f\u6ca1\u6709\u88ab\u7d22\u5f15\u7684\u5fc5\u8981\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 robots.txt \u963b\u6b62\u8fd9\u4e9b\u9875\u9762\u88ab\u641c\u7d22\u5f15\u64ce\u722c\u866b\u548c\u673a\u5668\u4eba\u6293\u53d6\u3002<\/p>\n<p>2.\u6700\u5927\u5316\u6293\u53d6\u9884\u7b97<\/p>\n<p>\u5982\u679c\u4f60\u5f88\u96be\u5c06\u6240\u6709\u9875\u9762\u7f16\u5165\u7d22\u5f15\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u6293\u53d6\u9884\u7b97\u95ee\u9898\u3002\u901a\u8fc7\u4f7f\u7528 robots.txt \u5c4f\u853d\u4e0d\u91cd\u8981\u7684\u7f51\u9875\uff0cGooglebot \u53ef\u4ee5\u5c06\u66f4\u591a\u7684\u6293\u53d6\u9884\u7b97\u82b1\u5728\u771f\u6b63\u91cd\u8981\u7684\u7f51\u9875\u4e0a\u3002\u63a8\u8350\u9605\u8bfb\uff1a<a href=\"https:\/\/cn.hostease.com\/blog\/seo\/117.html\" target=\"_blank\" rel=\"noopener\">\u300a\u5b66\u4e60SEO\u9700\u8981\u638c\u63e1\u54ea\u4e9b\u6280\u5de7\u77e5\u8bc6\u300b<\/a><\/p>\n<p>3.\u9632\u6b62\u8d44\u6e90\u7d22\u5f15<\/p>\n<p>\u4f7f\u7528\u5143\u6307\u4ee4\u53ef\u4ee5\u50cf robots.txt \u4e00\u6837\u9632\u6b62\u9875\u9762\u88ab\u7d22\u5f15\u3002\u4f46\u662f\uff0c\u5143\u6307\u4ee4\u4e0d\u9002\u7528\u4e8e\u591a\u5a92\u4f53\u8d44\u6e90\uff0c\u4f8b\u5982 PDF \u548c\u56fe\u50cf\u3002\u8fd9\u79cd\u60c5\u51b5\u5c31\u9700\u8981robots.txt\u6765\u53d1\u6325\u4f5c\u7528\u4e86\u3002<\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u5728Google Search Console\u4e2d\u67e5\u770b\u5df2\u7f16\u5165\u7d22\u5f15\u7684\u9875\u9762\u6570\uff1a<\/p>\n<p>\u5982\u679c\u8be5\u6570\u5b57\u4e0e\u4f60\u8981\u7f16\u5165\u7d22\u5f15\u7684\u9875\u6570\u76f8\u5339\u914d\uff0c\u5219\u65e0\u9700\u8d39\u5fc3\u4f7f\u7528 robots.txt \u6587\u4ef6\u3002<\/p>\n<p>\u4f46\u662f\u5982\u679c\u8be5\u6570\u5b57\u9ad8\u4e8e\u9884\u671f(\u5e76\u4e14\u6709\u4e0d\u5e94\u7f16\u5165\u7d22\u5f15\u7684\u5df2\u7f16\u5165\u7d22\u5f15\u7684 URL)\uff0c\u90a3\u4e48\u662f\u65f6\u5019\u4e3a\u4f60\u7684\u7f51\u7ad9\u521b\u5efa\u4e00\u4e2a robots.txt \u6587\u4ef6\u4e86\u3002<\/p>\n<p>\u521b\u5efa\u4e00\u4e2arobots.txt \u6587\u4ef6<\/p>\n<p>robots.txt\u662f\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528Windows\u7684\u8bb0\u4e8b\u672c\u6765\u521b\u5efa\u3002\u4e0d\u8fc7\u4e0d\u7ba1\u6211\u4eec\u7528\u4f55\u79cd\u65b9\u5f0f\u6765\u521b\u5efa\uff0c\u683c\u5f0f\u90fd\u662f\u76f8\u540c\u7684\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<p>User-agent: X<\/p>\n<p>Disallow: Y<\/p>\n<p>User-agent\u6307\u4f60\u6b63\u5728\u4ea4\u8c08\u7684\u7279\u5730\u673a\u5668\u4eba\uff0cDisallow\u540e\u9762\u662f\u4f60\u60f3\u8981\u963b\u6b62\u7684\u9875\u9762\u6216\u8005\u5185\u5bb9\u3002\u63a8\u8350\u9605\u8bfb\uff1a<a href=\"https:\/\/cn.hostease.com\/blog\/seo\/578.html\" target=\"_blank\" rel=\"noopener\">\u300a\u516d\u4e2a2019\u5e74\u6700\u5e38\u89c1\u7684\u65c5\u6e38\u641c\u7d22\u5f15\u64ce\u4f18\u5316\u9519\u8bef\u300b<\/a><\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<p>User-agent: googlebot<\/p>\n<p>Disallow: \/images<\/p>\n<p>\u8fd9\u4e2a\u4f8b\u5b50\u76ee\u7684\u662f\u544a\u8bc9Google\u7684\u673a\u5668\u4eba\u4e0d\u8981\u7d22\u5f15\u7f51\u7ad9\u4e0a\u7684\u56fe\u7247\u6587\u4ef6\u3002<\/p>\n<p>\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528\u661f\u53f7 (*) \u4e0e\u5728\u7f51\u7ad9\u4e0a\u505c\u7559\u7684\u6240\u6709\u673a\u5668\u4eba\u4ea4\u8c08\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<p>User-agent: *<\/p>\n<p>Disallow: \/images<\/p>\n<p>\u610f\u4e3a\u544a\u8bc9\u6240\u6709\u673a\u5668\u4eba\u4e0d\u8981\u722c\u53d6\u7f51\u7ad9\u4e0a\u7684\u56fe\u7247\u6587\u4ef6\u3002<\/p>\n<p>\u8fd9\u53ea\u662frobots.txt \u6587\u4ef6\u7684\u4f17\u591a\u7528\u6cd5\u4e4b\u4e00\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e0d\u901a\u7684\u89c4\u5219\u6765\u963b\u6b62\u6216\u8005\u5141\u8bb8\u673a\u5668\u4eba\u6293\u53d6\u7f51\u7ad9\u7684\u4e0d\u540c\u5185\u5bb9\uff1a<\/p>\n<p>\u6709\u4e86robots.txt \u6587\u4ef6\uff0c\u4e0b\u4e00\u6b65\u5c31\u662f\u8ba9\u5b83\u6765\u751f\u6548\uff0c\u4ece\u6280\u672f\u4e0a\u8bb2\uff0crobots.txt \u6587\u4ef6\u53ef\u4ee5\u653e\u5728\u7ad9\u70b9\u7684\u4efb\u4f55\u76ee\u5f55\u4e0b\uff0c\u4f46\u4e3a\u4e86\u589e\u52a0robots.txt \u6587\u4ef6\u88ab\u627e\u5230\u7684\u51e0\u7387\uff0c\u6211\u5efa\u8bae\u5c06\u5176\u653e\u7f6e\u5728\u7f51\u7ad9\u7684\u6839\u76ee\u5f55\u4e0b\u3002<\/p>\n<p>\u68c0\u67e5\u9519\u8bef<\/p>\n<p>\u6b63\u786e\u8bbe\u7f6e robots.txt \u6587\u4ef6\u975e\u5e38\u91cd\u8981\uff0c\u4e00\u4e2a\u9519\u8bef\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6574\u4e2a\u7f51\u7ad9\u53ef\u80fd\u4f1a\u88ab\u53d6\u6d88\u7d22\u5f15\u3002Google\u6709\u4e00\u4e2a\u673a\u5668\u4eba\u6d4b\u8bd5\u5de5\u5177\uff0c\u53ef\u4ee5\u6765\u5e2e\u6211\u4eec\u68c0\u6d4b\uff1a<\/p>\n<p>\u5b83\u4f1a\u5411\u6211\u4eec\u5c55\u793arobots.txt \u6587\u4ef6\u4ee5\u53ca\u5b83\u53d1\u73b0\u7684\u4efb\u4f55\u9519\u8bef\u548c\u8b66\u544a\uff1a<\/p>\n<p>\u6ce8\u610f\uff1arobots.txt\u662f\u533a\u5206\u5927\u5c0f\u5199\u7684\uff0c\u786e\u4fdd\u6587\u4ef6\u540d\u662f\u5c0f\u5199\u3002\u63a8\u8350\u76f8\u5173\u9605\u8bfb\uff1a<a href=\"https:\/\/cn.hostease.com\/blog\/seo\/380.html\">\u300a\u65b0\u7ad9\u4e0d\u6536\u5f55\u7684\u4e3b\u8981\u539f\u56e0\u6709\u54ea\u4e9b\u300b<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>robots.txt\u662f\u4e00\u4e2a\u7528\u4ee5\u544a\u77e5\u641c\u7d22\u5f15\u64ce\u8718\u86db\u4e0d\u8981\u6293\u53d6\u7f51\u7ad9\u67d0\u4e9b\u9875\u9762\u6216\u8005\u5185\u5bb9\u7684\u6587\u4ef6\uff0c\u7edd\u5927\u591a\u6570\u4e3b\u6d41\u7684\u641c\u7d22\u5f15\u64ce\uff0c\u5305\u62ec &#8230; <a title=\"robots.txt\u7684\u4f5c\u7528\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u8bf4\u5b83\u5f88\u91cd\u8981\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/blog\/seo\/robots-txt%e7%9a%84%e4%bd%9c%e7%94%a8%e4%bb%a5%e5%8f%8a%e4%b8%ba%e4%bb%80%e4%b9%88%e8%af%b4%e5%ae%83%e5%be%88%e9%87%8d%e8%a6%81\/\" aria-label=\"\u9605\u8bfb robots.txt\u7684\u4f5c\u7528\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u8bf4\u5b83\u5f88\u91cd\u8981\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[380],"class_list":["post-2124","post","type-post","status-publish","format-standard","hentry","category-seo","tag-robots"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts\/2124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/comments?post=2124"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts\/2124\/revisions"}],"predecessor-version":[{"id":2125,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts\/2124\/revisions\/2125"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/media?parent=2124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/categories?post=2124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/tags?post=2124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}