CodeIgniter Forums

Full Version: CI Route question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi guys, i am new to Codelgniter.  I have a question for the CI url routing.
Here is CI user guide examples

example 1:
$route['journals'] = 'blogs';

A URL containing the word “journals” in the first segment will be remapped to the “blogs” class.

example 2:
$route['blog/joe'] = 'blogs/users/34';

A URL containing the segments blog/joe will be remapped to the “blogs” class and the “users” method. The ID will be set to “34”.

It works with example 1.  

But I try example 2,  use $this->uri->segment(3),  it cannot receive the parameter ID 34, the segment(3) is a NULL value,

[Image: 40642a856e.jpg]


How this work out? Thanks!
Hi,
Use rsegment as your url is re-routed.
See