I'm trying to see if there's a way to basically set up one rule to run
the site...
So, I'm looking at URLs like:
www.mysite.com/wagons/red/small
Below works:
Rule:
^com/([_0-9a-z-]+)/([_0-9a-z-]+)/([_0-9a-z-]+)
...or, a little more open ended:
^([^/]+)/([^/]+)/([^/]+)/?$
Map either to and it works:
www.mysite.com/test.cfm?var1={R:1}&var2={R:2}&var3={R:3}
Here's where my head starts to hurt though...
1. {R1} will always be a specific section (folder) for the site and
always exist. No big deal.
2. {R2} and {R3} could be anything - work, date, whatever - depending on
the section {R1}. No problem here either.
3. Here's my problem. {R2} and {R3} may or may NOT always exist. So,
we could have "www.mysite.com/wagons/red/" or "www.mysite.com/wagons/".
Current rules above will error with either of these because the patter
no longer matches. I see how to do this with three rules, but that seems
stupid to do.
4. If there's a ".cfm" (which makes this sorta no too bad off-topic)
extension anywhere, ignore the whole thing.
Can one rule do this? I'm still reading regex/IIS rewrite stuff on blogs
and such. If anybody has a good reference for my specific instance above
I'd appreciate it!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323276
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4