You need to change your documentation of URI Routing to mention the fact that you can only use one regular expression. I learned this the hard way after tearing my hair out for a couple of hours trying to figure out why my set of regular expressions did not work.
For example, suppose you have a URI with the following segments:
/something/index/seg1/seg2/seg3/
and you try to use these two regular expressions:
$route[’(.*)/seg1/(.*)’] = “$1/newseg1/$2”;
$route[’(.*)/seg2/(.*)’] = “$1/newseg2/$2”;
then instead of getting what you would expect:
/something/index/newseg1/newseg2/seg3/
you actually get:
/something/index/newseg1/seg2/seg3/
The second regular expression is simply ignored. Either one in isolation works, but put together, only the first one gets applied. For me, at least, this was very unexpected and confusing behavior. In the documentation is this note:
“Note: Routes will run in the order they are defined. Higher routes will always take precedence over lower ones.”
I don’t know if this statement was intended to document the odd behavior, but if so, it was completely unclear to me. In fact, I still don’t know what it means.
Or maybe this is a bug and has since been fixed? I’m using V1.7.3.
Thanks!
