Routes not working - 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: Routes not working (/showthread.php?tid=14943) |
Routes not working - El Forum - 01-21-2009 [eluser]otherjohn[/eluser] Hi all, I cant seem to get my routes to work and think maybe I am missing something somewhere. Instead of going to the right page, it alway I am using php5 on the server Routes.php Code: $route['default_controller'] = "home"; A page /code-9xx/ should pull the DirectoryPage Control but instead pulls the default_controller. Code: class DirectoryPage extends Controller { config.php Code: $config['index_page'] = ""; .htaccess Code: AddHandler application/x-httpd-php5 .php Routes not working - El Forum - 01-21-2009 [eluser]Phil Sturgeon[/eluser] Code: $route['default_controller'] = "home"; This would be trying to load directorypage/9 instead of directorypage/index/9. Routes not working - El Forum - 01-21-2009 [eluser]otherjohn[/eluser] Thanks, I changed this Code: $route['code-([0-9]{1})xx'] = "directorypage/$1" Code: $route['code-([0-9]{1})xx'] = "directorypage/index/$1" and its still routing to the default. Routes not working - El Forum - 01-21-2009 [eluser]Phil Sturgeon[/eluser] Then you had 2 errors. Try and take this one step at a time. Does it work without the .htaccess? Routes not working - El Forum - 01-21-2009 [eluser]otherjohn[/eluser] if i put in /index.php/code-9xx it works. And if I remove the .htaccess and use the index.php it works. Routes not working - El Forum - 01-22-2009 [eluser]otherjohn[/eluser] This is really frustrating. I have tried Code: $route['directorypage'] = "directorypage/$1/index"; I have a feeling its some setting somewhere. John Routes not working - El Forum - 01-22-2009 [eluser]Phil Sturgeon[/eluser] Is this local or on your dev/production server? I find changing $config['uri_protocol'] to REQUEST_URI often solves this. Although this solves the problem, I do not want to use REQUEST_URI, but PATH_INFO. Any ideas people? Routes not working - El Forum - 01-22-2009 [eluser]otherjohn[/eluser] Well that did it! So what does this mean, if this worked? |