コンテンツにスキップ

Robots Exclusion Standard

出典: フリー百科事典『ウィキペディア(Wikipedia)』

Robots Exclusion Standard(RES)  Robots Exclusion Protocol robots.txt 使使Sitemaps使

[]


"robots.txt" 1994WebCrawler Martijn Koster 19946 robots-request@nexor.co.uk [1]"robots.txt" AltaVista

20071130ACAP (Automated Content Access Protocol) v1.0  Robots Exclusion Standard [2]Google

2019GoogleIETF[3]20229RFC 9309[4]

[]


 robots.txt www.example.com/robots.txt

robots.txt 

 robots.txt example.com  robots.txt a.example.com example.com  robots.txt  a.example.com 

[]


robots.txt robots.txt 使

robots.txt  '/' 

[]


 "*" 
User-agent: *
Disallow:

あらゆるボットが全ファイルを走査できないようにした例。

User-agent: *
Disallow: /

あらゆるボットが4つのディレクトリ配下を見ないよう指定した例。

User-agent: *
Disallow: /cgi-bin/
Disallow: /images/
Disallow: /tmp/
Disallow: /private/

特定のクローラが特定のディレクトリ配下に行かないよう指定した例。

User-agent: BadBot # replace the 'BadBot' with the actual user-agent of the bot
Disallow: /private/

あらゆるボットが特定のファイルを見ないよう指定した例。

User-agent: *
Disallow: /directory/file.html

この場合、そのディレクトリ配下の他のファイルはボットから隠蔽されない。

"#" からその行末まではコメントとして扱われる。

# Comments appear after the "#" symbol at the start of a line, or after a directive
User-agent: * # match all bots
Disallow: / # keep them out

規格外の拡張[編集]

Crawl-delay ディレクティブ[編集]

いくつかの主要なクローラは Crawl-delay というパラメータをサポートしている。同一サーバに要求を繰り返す場合に指定された時間だけ待つよう指示するものである[5][6][7]

User-agent: *
Crawl-delay: 10

Allow ディレクティブ[編集]

いくつかの主要なクローラは Allow ディレクティブをサポートしており、それに続く Disallow ディレクティブの逆の作用をする[8][9]。これは、あるディレクトリ全体を隠蔽したいが、その中の一部ファイルだけは隠蔽したくないという場合に使う。標準的実装では常に先に書いてあるディレクティブが優先されるが、Googleは Allow のパターンを全て先に評価し、その後 Disallow のパターンを評価する。Bing は AllowDisallow も最も具体的なものを優先する[10]

あらゆるボットで互換な動作にするには、あるファイルへのアクセスを許す Allow ディレクティブを先に書き、そのファイルを含むディレクトリについての Disallow ディレクティブを後に書く。以下に例を挙げる。

Allow: /folder1/myfile.html
Disallow: /folder1/

この場合、/folder1/ というディレクトリの /folder1/myfile.html というファイル以外は隠蔽する。Googleに対しては順序は重要ではない。

Sitemap ディレクティブ[編集]

一部のクローラは Sitemap ディレクティブをサポートしており、1つの robots.txt の中で複数のSitemapsを指定できる[11]

Sitemap: http://www.gstatic.com/s2/sitemaps/profiles-sitemap.xml
Sitemap: https://www.google.com/hostednews/sitemap_index.xml

拡張規格[編集]

Extended Standard for Robot Exclusion と題してRESの拡張規格が提案されている。追加されたディレクティブとしては Visit-timeRequest-rate がある。例えば次のようになる。

User-agent: *
Disallow: /downloads/
Request-rate: 1/5         # maximum rate is one page every 5 seconds
Visit-time: 0600-0845     # only visit between 06:00 and 08:45 UTC (GMT)

脚注・出典[編集]



(一)^ A Standard for Robot Exclusion

(二)^ Information ACAP

(三)^  (201972). GoogleREPWEB.  Engadget . 2022219202084

(四)^ Koster, Martijn (202299). RFC [https://datatracker.ietf.org/doc/html/rfc9309 9309: Robots Exclusion Protocol] (). IETF Datatracker. 2022128

(五)^ How can I reduce the number of requests you make on my web site?. Yahoo! Slurp. 2007331

(六)^ MSNBot  Web . MSNBot  Web . 2010923

(七)^ About Ask.com: Webmasters. 2010923

(八)^ Google - robots.txt 使. 20071120

(九)^ How do I prevent my site or certain subdirectories from being crawled? - Yahoo Search Help. 20071120

(十)^ Robots Exclusion Protocol - joining together to provide better documentation. 2009123

(11)^ Yahoo! Search Blog - Webmasters can now auto-discover with Sitemaps. 2009323

関連項目[編集]

外部リンク[編集]