Simple routing issue - please help! - 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: Simple routing issue - please help! (/showthread.php?tid=52319) |
Simple routing issue - please help! - El Forum - 06-06-2012 [eluser]Sven Delle[/eluser] I have this in my routes file: Code: $route['default_controller'] = 'site'; Simply to remove the 'site' part from the url. And in my Site Controller i have a function showcase. Now I want to add a movie function and adds it to my Site Controller. I then add this to my routes file: $route['movie/(:any)'] = 'site/movie/$1'; But this gives me a Page Not Found Error. Now, why the h... is that happening? Simple routing issue - please help! - El Forum - 06-06-2012 [eluser]weboap[/eluser] check this article http://bizwidgets.biz/web-design/codeigniter-routes-trick-removing-controller-names-from-the-uri-to-keep-urls-short/ Simple routing issue - please help! - El Forum - 06-06-2012 [eluser]Sven Delle[/eluser] Thanks. But that doesn't solve my problem. I have solved the idea of sending the user to anything but. But if you look at my code, I can send users to the showcase function using: Code: $route['showcase/(:any)'] = 'site/showcase/$1'; So adding a movie function (exactly as the showcase function) to the site controller and adding: $route['movie/(:any)'] = 'site/movie/$1'; Should work. Well, it doesn't. I even tried adding movie to the exception rule (even though showcase works fine without adding it) like so: Code: $route['((?!movie|admin|login).*)'] = 'site/index/$1'; There HAS to be something wrong with this routing thing, or? |