Welcome Guest, Not a member yet? Register   Sign In
What is wrong in this route rule?
#1

[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?
#2

[eluser]danmontgomery[/eluser]
You have to use groups to use backreferences:

Code:
$route['[^/]+/(:any)/pos'] = 'index/$1';
#3

[eluser]chefnelone[/eluser]
[quote author="noctrum" date="1279214130"]You have to use groups to use backreferences:

Code:
$route['[^/]+/(:any)/pos'] = 'index/$1';
[/quote]

thanks noctrum




Theme © iAndrew 2016 - Forum software by © MyBB