The problem with that is, I have 40+ rules in place already and the items
can be at the end of all of them.

Could I do something like this?

^something/?(item1)?/?(item2)/?(item3)/?(item4)/?(item5)/?(item6)/?

Rewrite to:

somefile.cfm?items=$1,$2,$3,$4,$5,$6

Which could turn into any one of:

somefile.cfm?items=item1,item2,,,,
somefile.cfm?items=item1,,,item4,,item6
somefile.cfm?items=,,,,,

Then do another rewrite to remove any multiple commas.

Can I rewrite the same URL more than once?

So take the result of one rewrite and pass it to another?

I'm looking though the docs at the moment.

Adrian

-----Original Message-----
From: Russ [mailto:[EMAIL PROTECTED]
Sent: 29 February 2008 17:17
To: CF-Talk
Subject: RE: OT - URL Rewriting, an unknown number of items


The simplest way would be to write a rule for each item up to a max that you
think you'd hit

RewriteRule ^something/([^/])+/*$       /somefile.cfm?items=$1
RewriteRule ^something/([^/])+/([^/])+/*$       /somefile.cfm?items=$1,$2
RewriteRule ^something/([^/])+/([^/])+/([^/])+*$
/somefile.cfm?items=$1,$2,$3

And so on.



> -----Original Message-----
> From: Adrian Lynch [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 29, 2008 12:03 PM
> To: CF-Talk
> Subject: RE: OT - URL Rewriting, an unknown number of items
>
> Sorry, I didn't say what I wanted out the other end...
>
> something/item1/item2/item3
>
> would become somefile.cfm?items=item1,item2,item3
>
> The something/somefile parts aren't important, it's the items that I need.
>
> Cheers.
>
> -----Original Message-----
> From: Jordan Michaels
> Sent: 29 February 2008 16:59
> To: CF-Talk
> Subject: Re: OT - URL Rewriting, an unknown number of items
>
>
> Just to clarify, are you wanting to deal with a list of variables, like
> so:
>
> fruits = orange, apple, pear, etc
>
> Or are you looking for item1, item2, item3 to contain values to
> different variables?
>
> Warm regards,
> Jordan Michaels
> Vivio Technologies
> http://www.viviotech.net/
> BlueDragon Alliance Member
> [EMAIL PROTECTED]
>
>
> Adrian Lynch wrote:
> > Sorry again for the OT.
> >
> > I have a URL in the form:
> >
> > /with/item1/item2/item3/
> >
> > Where there can be any number of items.
> >
> > Is there a RegEx to deal with this?
> >
> > I could cap the number of items to something acceptable, but either way
> > would be find.
> >
> > Thanks.
> >
> > Adrian Lynch


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:300204
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to