What is wrong in this route rule? |
[eluser]chefnelone[/eluser]
hello I have this route where I need to have the :any segment in the $2 variable. Code: $route['[^/]+/:any/pos'] = 'index/$2'; Then if I have this url: www.misite.com/es/products/pos I'd expect that the route call to: index/products but it doesn't work... But it works fine with: Code: $route['[^/]+/products/pos'] = 'index/products'; I can't see my mistake, /:any/ is segment 2, It isn't?
[eluser]danmontgomery[/eluser]
You have to use groups to use backreferences: Code: $route['[^/]+/(:any)/pos'] = 'index/$1';
[eluser]chefnelone[/eluser]
[quote author="noctrum" date="1279214130"]You have to use groups to use backreferences: Code: $route['[^/]+/(:any)/pos'] = 'index/$1'; thanks noctrum |
Welcome Guest, Not a member yet? Register Sign In |