ROBOTS and Uranus System: Difference between pages

From NikkiWiki
(Difference between pages)
Jump to navigation Jump to search
 
Tag: New redirect
 
Line 1: Line 1:
[[image:Exciting Comics 3.jpg|thumb|[Image.]&ensp; The Robots Exclusion Protocol will not prevent bad bots from accessing your website. <ref><code>[[commons:category:robots in art]]</code></ref>]]
#redirect [[Solar System by orbit#Uranian System]]


One of the first files you should add to your website is "<code>/robots.txt</code>". <ref><code>https://www.rfc-editor.org/rfc/rfc9309</code></ref> <ref><code>https://www.robotstxt.org/</code></ref>&ensp; This is a plaintext file for the Robots Exclusion Protocol (ROBOTS language, Internet Society Request for Comments [RFC] 9309). <ref><code>https://www.robotstxt.org/robotstxt.html</code></ref>&ensp; What the "<code>/robots.txt</code>" file does is instruct which webdirectories should be accessed or avoided by web bots.
[[category:astronomy]]
 
An important thing to remember is that no bot is <em>required</em> to follow the Robots Exclusion Protocol. <ref><code>https://www.robotstxt.org/faq/prevent.html</code></ref> <ref><code>https://www.robotstxt.org/faq/blockjustbad.html</code></ref> <ref><code>https://www.robotstxt.org/faq/legal.html</code></ref>&ensp; The protocol only affects the behavior of compliant or well-behaved bots and anyone can program a bot to ignore the Robots Exclusion Protocol.&ensp; As such, you should <em>not</em> use the Robots Exclusion Protocol to try to hide sensitive directories, especially since publicly listing the directories in "<code>/robots.txt</code>" simply gives malicious bots an easy way to find the very directories you don't want them to visit. <ref><code>https://www.robotstxt.org/faq/nosecurity.html</code></ref>&ensp; On Apache HTTP (Hypertext Transfer Protocol) Server, you should use "<code>/.htaccess</code>" (hypertext access) instead to hide directories from public access.
 
== documentation ==
 
* [https://www.rfc-editor.org/rfc/rfc9309 Internet Society RFC 9309: Robots Exclusion Protocol]
* [https://www.robotstxt.org/ <code>robotstxt.org</code>: The Web Robots Pages]
* [https://developers.google.com/search/docs/crawling-indexing/robots/ Google Developers: Introduction to <code>robots.txt</code>]
* [[wikipedia:robots.txt|<code>robots.txt</code> (Wikipedia)]]
 
== editor ==
 
{{webtext editor}}
 
== directory ==
 
"<code>robots.txt</code>" will only work from the root webdirectory ("<code>/</code>"). <ref><code>https://www.robotstxt.org/faq/shared.html</code></ref>
 
== comments ==
 
Comments are added to the Robots Exclusion Protocol with a hash ("<code>#</code>") at the beginning of a new line.
 
<highlight lang="robots">
# A comment.
</highlight>
 
== examples ==
 
=== public ===
 
For a public website, you want to allow access to all bots in order to get the site crawled and indexed by as many search engines as possible.&ensp; The following "<code>/robots.txt</code>" allows all bots access to all files and directories (minus anything excluded by "<code>/.htaccess</code>").
 
<code><highlight lang="robots">
User-agent: *
Disallow:
# All bots can crawl/index all files and directories.
</highlight></code>
 
=== private ===
 
Websites and webdirectories that are not publicly indexed on search engines are referred to as the "[[wikipedia:deep web|deep web]]" or "deepnet" (not to be confused with the "[[wikipedia:dark web|dark web]]" or "darknet"). <ref><code>[[wikipedia:deep web]]</code></ref> <ref><code>[[wikipedia:dark web]]</code></ref>&ensp; For example, you may want to create a mirror of your website for testing purposes but don't want the development website publicly indexed since it will create duplicate or misleading results on search engines.&ensp; The following "<code>/robots.txt</code>" creates a "deepnet" website that instructs all bots compliant with the Robots Exclusion Protocol to not crawl or index any part of the site.
 
<code><highlight lang="robots">
User-agent: *
Disallow: /
# No compliant bots will crawl/index any files or directories.
</highlight></code>
 
=== hybrid ===
 
The following "<code>/robots.txt</code>" excludes two webdirectories ("<code>/sandbox/</code>" and "<code>/testbox/</code>") from crawling/indexing but permits access to all other files and directories on the site.
 
<code><highlight lang="robots">
User-agent: *
Disallow: /sandbox/
Disallow: /testbox/
# Compliant bots will crawl/index all files and directories except for "/sandbox/" and "/testbox/" (exclusion is applied recursively to all subdirectories of "sandbox" and "testbox").
</highlight></code>
 
== SITEMAP ==
 
<u>[[SITEMAP#ROBOTS|SITEMAP]]</u> is an extension of the Robots Exclusion Protocol to allow listing a [https://www.sitemaps.org/ sitemap] in the "<code>/robots.txt</code>" file. <ref><u><code>[[SITEMAP#ROBOTS]]</code></u></ref> <ref><code>https://www.sitemaps.org/</code></ref> <ref><code>https://www.sitemaps.org/protocol.html</code></ref>&ensp; Having a precompiled list of links for the website available makes the bot's job to crawl and index the site a lot easier and more efficient.&ensp; Since the first thing a good bot does when accessing a website is to check for a "<code>/robots.txt</code>" file, it is best to have the link to the sitemap listed directly in the "<code>/robots.txt</code>" file so the bot doesn't have to guess whether or not the website has a sitemap available (which could be either "<code>/sitemap.txt</code>" or "<code>/sitemap.xml</code>").&ensp; The following "<code>/robots.txt</code>" provides an example of a public website with a sitemap.&ensp; Note that unlike the other ROBOTS instructions, the sitemap should be provided with a full URL (uniform resource locator) and not with a relative link.
 
<code><highlight lang="robots">
User-agent: *
Disallow:
Sitemap: https://www.example.net/sitemap.xml
</highlight></code>
 
== SECURITY ==
 
Additional protocols such as <u>[[SECURITY]]</u> and <u>[[HUMANS]]</u> can also be added to the Robots Exclusion Protocol but these are not officially supported so should be commented out to avoid confusing bots while still allowing nonbot users to find the relevant files.&ensp; The example below shows "<code>/robots.txt</code>" for a public website that includes additional protocols for SITEMAP, SECURITY, and HUMANS.
 
<code><highlight lang="robots">
User-agent: *
Disallow:
Sitemap: https://www.example.net/sitemap.txt
# Security: https://www.example.net/.well-known/security.txt
# Humans: https://www.example.net/humans.txt
</highlight></code>
 
== Nicole Sharp's Website ==
 
Below is the Robots Exclusion Protocol of "<u><code>[https://www.nicolesharp.net/robots.txt nicolesharp.net/robots.txt]</code></u>" showing hidden directories ("<code>/sandbox/</code>" and "<code>/testbox/</code>") for webdevelopment plus additional protocols and comments, including a comment line to provide <u>[[attribution]]</u> to the author of the file (<u>[[Nicole Sharp]]</u>).
 
<code><highlight lang="robots">
User-agent: *
Disallow: /sandbox/
Disallow: /testbox/
Sitemap: https://www.nicolesharp.net/sitemap.txt
# Security: https://www.nicolesharp.net/security.txt
# Humans: https://www.nicolesharp.net/humans.txt
 
# Robots Exclusion Protocol for Nicole Sharp's Website.
# 2023-09-04 Nicole Sharp
# https://www.nicolesharp.net/
</highlight></code>
 
== MediaWiki ==
 
[[mw:Main Page|Wikimedia MediaWiki]] automatically applies different META ROBOTS instructions in the HEAD element to different pages, so you should not add any custom ROBOTS instructions via [[mw:HeadScript|HeadScript]].
 
To get webcrawlers to follow links on MediaWiki, add the following to "<code>[[mw:$wgNoFollowLinks|LocalSettings.php]]</code>". <ref><code>[[mw:$wgNoFollowLinks]]</code></ref>
 
<code><syntaxhighlight lang="php">
$wgNoFollowLinks = false;
# https://www.mediawiki.org/wiki/$wgNoFollowLinks
</syntaxhighlight></code>
 
== see also ==
 
* <u><code>https://www.nicolesharp.net/robots.txt</code></u>
* <code>https://www.rfc-editor.org/rfc/rfc9309</code>
* <code>https://www.robotstxt.org/</code>
* <code>https://developers.google.com/search/docs/crawling-indexing/robots/</code>
* <code>[[wikipedia:ROBOTS]]</code>
* <u><code>[[SITEMAP]]</code></u>
* <u><code>[[SECURITY]]</code></u>
* <u><code>[[HUMANS]]</code></u>
 
== references ==
 
<references />
 
== keywords ==
 
<code>bots, development, HUMANS, humans.txt, indexing, ROBOTS, robots.txt, SECURITY, security.txt, searchbots, SITEMAP, sitemap.txt, TXT, web, webcrawlers, webcrawling, webdevelopment, WWW</code>
 
{{#seo:|keywords=bots, development, HUMANS, humans.txt, indexing, ROBOTS, robots.txt, SECURITY, security.txt, searchbots, SITEMAP, sitemap.txt, TXT, web, webcrawlers, webcrawling, webdevelopment, WWW}}
 
[[category:webdevelopment]]
[[category:pages with images]]

Latest revision as of 2023-09-15T22:39:39