> On Wed, 23 Jul 2008, Steve Cayford wrote:
>> In perl regexes you can use ".*?" instead of ".*" to make it a non-greedy
>> match. Does that work?

Yes! This works great. I also added the * as Mike suggested to allow
multiple trailing slashes
RewriteRule ^(.*?)/*?$ ${txtmap:$1} [L]

Mike's rules below do also work but I'm not sure I understand how they
differ from the one above, $1 does not include the trailing slash, and
all the listed examples match. The URL which the visitor typed does
not change in any case. I think I would have to redirect if I wanted
the the trailing slash to be dropped from what the user sees in the
address. But everything works :-). Thanks for your help!


On Wed, Jul 23, 2008 at 6:51 PM, Mike Miller <mbmiller at taxa.epi.umn.edu> wrote:
>  I think maybe this is what you want to handle all cases:
>
> RewriteRule ^(([^/]+?/)*[^/]+)/?$ ${txtmap:$1} [L]
>
> itmatchesthis
> andthis/
> and/it/matches/this
> and/it/matches/this/
>
> ...and the trailing slash is dropped such that $1 never has a trailing
> slash.  By the way, this might be just as good:
>
> RewriteRule ^(([^/]+?/)*[^/]+)/*$ ${txtmap:$1} [L]
>
> I replaced a question mark with an asterisk to allow any number of trailing
> slashes, all of which are not held in $1.
>
> I don't know if any of this works for you though.
>
> Mike
>



-- 
Tom Penney
612-920-3562