views:

62

answers:

3

Wondering if following will work for google in robots.txt

Disallow: /*.action

I need to exclude all urls ending with .action.

Is this correct?

A: 

I don't think it will work, you would need to move all .action files to a location which you then disallow

cymorg
+2  A: 

The robots.txt specification provides no way to include wildcards, only the beginning of URIs.

Google implement non-standard extensions, described in their documentation (look in the Manually create a robots.txt file section under "To block files of a specific file type").

David Dorward
+4  A: 

To block files of a specific file type (for example, .gif), use the following:

User-agent: Googlebot
Disallow: /*.gif$

So, you are close. Use Disallow: /*.action$ with a trailing "$"

Of course, that's merely what Google suggests: http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449

All bots are different.

Ben Griswold
Great! And if I want to block /some.action?id=111In this case we dont need $ symbol
Alexey