Thanks Ben! I did think this at the beginning, not sure why I gave up on the
idea :OD

Adrian

-----Original Message-----
From: Ben Doom
Sent: 29 February 2008 17:39
To: CF-Talk
Subject: Re: OT - URL Rewriting, an unknown number of items


Instead of trying to rewrite the list this way, wouldn't it make more
sense to do something like:

^something/(.+) /somefile.cfm?items=$1

Then you could traverse the item list in CF using / as a delimiter, and
not have to have multiple rules for the URLS.

Of course, that all assumes that the item list is the last bit of the
URL, which may or may not be true.

--Ben Doom

Russ wrote:
> 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:300206
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