8th November 2006

Yahoo! Search Crawler (Yahoo! Slurp) - Supporting wildcards in robots.txt

Source: ysearchblog.com

I was going through my notes from Danny Sullivan’s Open Feedback sessions that occur during the ‘Meet the Crawlers’ panel at  Search Engine Strategies. One of the items on my list was a request for enhanced syntax in robots.txt to make it easier for webmasters to manage how search crawlers, including Slurp, access your content.

For those who may not be as familiar with search index terminology, webmasters use the robots.txt file to direct robots that visit their site, including search engine crawlers, which files should be crawled and which shouldn’t be. You can read about our support for robots directives in the help forYahoo! Slurp.

Well, we can scratch that one off the list, since we have just updated Yahoo! Slurp to recognize two additional symbols in the robots.txt directives – ‘*’ and ‘$’. The semantics of these is what is as widely understood for robots.txt files.

‘*’ - matches a sequence of characters

You can now use ‘*’ in robots directives for Yahoo! Slurp to wildcard match a sequence of characters in your URL. You can use this symbol in any part of the URL string you provide in the robots directive. For example,

User-Agent: Yahoo! Slurp
Allow: /public*/
Disallow: /*_print*.html
Disallow: /*?sessionid

The robots directives above will:

  • allow all directories that begin with ‘public’, such as ‘/public_html/’ or ‘/public_graphs/’ to be crawled
  • disallow any files or directories which contain ‘_print’, such as ‘/card_print.html’ or ‘/store_print/product.html’ to be crawled
  • disallow any files with ‘?sessionid’ in their URL string, such as ‘/cart.php?sessionid=342bca31’ to be crawled

Note that a trailing ‘*’ is redundant since that is existing matching behavior for Slurp. So, the following two directives are equivalent:

User-Agent: Yahoo! Slurp
Disallow: /private*
Disallow: /private

‘$’ – anchors at the end of the URL string

You can now also use ‘$’ in robots directives for Slurp to anchor the match to the end of the URL string. Without this symbol, Yahoo! Slurp would match all URLs against the directives, treating the directives as a prefix. For example:

User-Agent: Yahoo! Slurp
Disallow: /*.gif$
Allow: /*?$

The robots directives above will

  • Disallow all files ending in ‘.gif’ in your entire site. Note that without the ‘$’, this would disallow all files containing ‘.gif’ in their file path
  • Allow all files ending in ‘?’ to be included. This would not automatically allow files that just contain ‘?’ somewhere in the URL string

As you can see, this symbol only makes sense at the end of the string. Hence, when we see it, we assume that your directive terminates there and any characters after that symbol are ignored.

Oh, by the way, if you thought we didn’t support the ‘Allow’ tag, as you can see from these examples, we do.

Spread the word: readit

This entry was posted on Wednesday, November 8th, 2006 at 12:06 am and is filed under SEO/Search Engine News. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

Leave a Reply

Spread the Word
delicious
digg
technorati
reddit
magnolia
stumbleupon
yahoo
google
  • Subscribe

  • Add to Google
  • Add to My Yahoo!
  • Subscribe with Bloglines
  • Subscribe in NewsGator Online
  • Add to Technorati Favorites!
  • Feedburner Reader
  • Get free E-Book on blogging

  • Online Marketing
  • RSS


eXTReMe Tracker