CodeIgniter Forums
[ASK] Error when setting new routes - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [ASK] Error when setting new routes (/showthread.php?tid=51741)



[ASK] Error when setting new routes - El Forum - 05-16-2012

[eluser]Wilianto Indrawan[/eluser]
hello guys, i need your help.

i have an URL: http://mydomain.com/view/page/about
then i want change it to be: http://mydomain.com/page/about

i've tried add a new routes:
Code:
$route['page/(:any)'] = 'view/page/$1';

but when i refresh my browser, it always show the page in: http://mydomain.com/view/page/default_value
any advice to solve my problem?

thank you before


[ASK] Error when setting new routes - El Forum - 05-16-2012

[eluser]Wilianto Indrawan[/eluser]
I also try set the default controller to:

Code:
$route['default_controller'] = "view/page/about"; // controller/method/id

but the browser print only "view/page/" the "id" can't printing.

i use codeigniter 2.1.



[ASK] Error when setting new routes - El Forum - 05-16-2012

[eluser]Wilianto Indrawan[/eluser]
Problem solve.

I must change

Code:
$this->uri->segment(3)

into

Code:
$this->uri->segment(2)

on my controller file