by franze · 6y ago · 0 comments
and even though robots.txt seems like a very, very simple text based protocoll there are unanswered mysteries
the biggest mystery is user agent groups and comments
i.e.:
User-agent: googlebot
User-agent: bing
User-agent: yandex
Disallow: /
so i am disallowing everything for google, bing, yandex; easy enough, but: User-agent: googlebot
User-agent: yandex
Disallow: /
means that googlebot has no instructions, but yandex is disallowed all.if a whole line is commented out
User-agent: googlebot
#User-agent: bing
User-agent: yandex
Disallow: /
is a commented out line a blank line or a non existing line?if it is interpreted as a blank linke, the disallow only counts for yandex, if the line is non existant, it counts for googlebot and yandex.
i like simple things, but sometimes the complexity is between the lines.
User-agent: googlebot
#User-agent: bing
User-agent: yandex
Disallow: /
why would it be interpreted as a blank line? If you remove everything after the #, that includes the new line characters at the end of the line. Leaving: User-agent: googlebot
User-agent: yandex
Disallow: / User-agent: googlebot
User-agent: bing #behaved-badly
User-agent: yandex
Disallow: /
if # removes everythin afer the #, then it would be User-agent: googlebot
User-agent: bing User-agent: yandex
Disallow: /
which results into the whole line " User-agent: bing User-agent: yandex" beeing thrown out as malformed, so only googlebot would be disallowed.Edit: I don't know how to escape in HN formatting. Obviously there are italics where literal asterisks should be.
*** You can just use three asterisks. ***
* You can just use three asterisks. * Unfortunately you need something after them though. ***
Unfortunately you need something after them though. *(`^#.$`), and others will interpret it as you have (`^#.?\n`)*
(Not sure where you intended those asterisks. I made my best inference.)Have you observed one/both behaviours?