[eluser]Volder[/eluser]
hello
I am facing the following problem:
I have controller called 'Main', there I have a function 'test':
Code:
function test()
{
print_r($this->uri->segments);
echo "<br />";
print_r($this->uri->rsegments);
echo "<br />";
echo "hello, Wolrd";
}
in the routes config I have:
Code:
$route['test(/.*|$)'] = 'main/test$1';
$route['(.*)/page([0-9]+)$'] = '$1/page/$2';
what I want to achieve is when I input:
Code:
mysite_url/test/page3
I would be rerouted to
Code:
mysite_url/main/test/page/3
but I am sent to
Code:
mysite_url/main/test/page3
that means the second routing instruction is not triggering for me.
in the user_guide I read that:
Quote:Note: Routes will run in the order they are defined. Higher routes will always take precedence over lower ones.
and I understand this in the way that my first instruction will transform:
Code:
mysite_url/test/page3 => mysite_url/main/test/page3
and second:
Code:
mysite_url/main/test/page3 => mysite_url/main/test/page/3
but seems it doesn't.
can anyone help one this?