routes.php question - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: routes.php question (/showthread.php?tid=56662) |
routes.php question - El Forum - 01-09-2013 [eluser]stevea[/eluser] I'm new to CI and have just finished up the Static example in the User Manual Tutorial. Entering www.mysite.com/CI_Tutorial/ci/index.php/pags/view brings down the default home.php page, as expected, and entering www.mysite.com/CI_Tutorial/ci/index.php/pags/view/about brings down the about page, as expected. (Note that I've changed the controller name from pages to pags.) Then I set $route['default_controller'] = 'pags/view'; and that let me enter just www.mysite.com/CI_Tutorial/ci/index.php to bring down the default home page. No surprises yet. But now if set $route['default_controller'] = 'pags/view/$1'; and I enter www.mysite.com/CI_Tutorial/ci/index.php/about I get a 404. This surprises me, because if I use the other route example the tutorial gives: $route['(:any)'] = 'pags/view/$1'; that does let me enter www.mysite.com/CI_Tutorial/ci/index.php/about and brings down the about page. Can someone explain what's going on here? Why doesn't www.mysite.com/CI_Tutorial/ci/index.php/about bring down the about page after I set $route['default_controller'] = 'pags/view/$1'; Thanks, Steve routes.php question - El Forum - 01-09-2013 [eluser]Aken[/eluser] The default controller route is only for when the homepage is viewed, aka example.com or example.com/index.php. |