Welcome to WebmasterWorld Guest from 54.224.0.153

Forum Moderators: goodroi

Message Too Old, No Replies

Robots.txt Pattern Matching

How Well Does It Work?

     
11:55 pm on Mar 8, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 26, 2000
posts:2176
votes: 0



I'm finishing up some work on a Cold Fusion site where the URL's have been rewritten to reomove all ?'s. However, Google has already indexed about 80 pages with .cfm? in the URL.

Since the old URLS will still work, we don't want Googlebot to return and end up indexing the same page twice, so I'm thinking of using a robots.txt that looks like

User-Agent: Googlebot
Disallow: /*.cfm?*

The goal being that if Googlebot returns through a previously indexed url, it will drop the old one and end up picking up the page with the new one. (.cfm/)

Has anyone done this, and if so, how well has it worked?

1:47 am on Mar 9, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:July 20, 2001
posts:449
votes: 0


I use this to prevent indexing of images and it works fine:

User-Agent: Googlebot
Disallow: /*.gif$
Disallow: /*.jpg$

(The $ indicates end of the filename if I recall correctly. I haven't tried it with a wildcard at the end.)

4:25 am on Mar 9, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 26, 2000
posts:2176
votes: 0



Yes, I've used it for images as well and it seems to work fine. But Google's help section doesn't show any examples of a wildcard being used after the file extension. It seems like it would work fine, but I'd like to know for sure before putting it up.
10:42 am on Mar 10, 2002 (gmt 0)

Administrator from US 

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 21, 1999
posts:38059
votes: 13


I've used *.cgi with success. I've not used the ? or anything after it.

On the images rjohara, you know you can use:


User-Agent: Googlebot-Image
Disallow: /
1:15 pm on Mar 15, 2002 (gmt 0)

Administrator from US 

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 21, 1999
posts:38059
votes: 13


Forwarded:

Patterns must begin with / because robots.txt patterns always match absolute URLs.
* matches zero or more of any character.
$ at the end of a pattern matches the end of the URL; elsewhere $ matches itself.
* at the end of a pattern is redundant, because robots.txt patterns always match any URL which begins with the pattern.

thanks