![]() |
$_GET and URI Routing - 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: $_GET and URI Routing (/showthread.php?tid=4964) |
$_GET and URI Routing - El Forum - 12-27-2007 [eluser]sixpack434[/eluser] Hi guys, great if someone can help i'm converting my old website to using codeigniter,the old method of showing lessons on the page is by passing the ID to the url. For example, to show lesson 10 the url would be www.sitename.com/lesson.php?ID=10 I thought I can use uri routing to pass users to the new page if they try to use the old method e.g. www.sitename.com/lesson/10 but this doesn't seem to work, my routing functionality is $route['lesson.php?ID=(\d+)'] = "lesson/$1"; This is throwing a 404 Page not found error Isn't it possible to solve this problem by way of routing? Any help is much appreciated $_GET and URI Routing - El Forum - 12-27-2007 [eluser]JamesD[/eluser] [quote author="sixpack434" date="1198813998"]Hi guys, great if someone can help i'm converting my old website to using codeigniter,the old method of showing lessons on the page is by passing the ID to the url. For example, to show lesson 10 the url would be www.sitename.com/lesson.php?ID=10 I thought I can use uri routing to pass users to the new page if they try to use the old method e.g. www.sitename.com/lesson/10 but this doesn't seem to work, my routing functionality is $route['lesson.php?ID=(\d+)'] = "lesson/$1"; This is throwing a 404 Page not found error Isn't it possible to solve this problem by way of routing? Any help is much appreciated[/quote] I believe you would need to do something more like this: Code: $route['lesson/(\d+)'] = "lesson/$1"; $_GET and URI Routing - El Forum - 12-27-2007 [eluser]sixpack434[/eluser] That doesn't work, it works if the user types lesson/2 but it just directs the user to lesson/2? :-| i want to direct users if they type lesson.php?ID=2 to lesson/2 Thanks for your suggestion any other ideas? $_GET and URI Routing - El Forum - 12-28-2007 [eluser]sixpack434[/eluser] can someone help? Isn't the routing functionality a way to overcome the missing support of $_GET in codeigniter? |