[Solved] Routing issue - need to redirect from url parameterized pages to new CodeIgniter nice urls - 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: [Solved] Routing issue - need to redirect from url parameterized pages to new CodeIgniter nice urls (/showthread.php?tid=24149) Pages:
1
2
|
[Solved] Routing issue - need to redirect from url parameterized pages to new CodeIgniter nice urls - El Forum - 11-02-2009 [eluser]ehicks727[/eluser] I echoed the $_GET['id'] in the routes file, and it is, in fact, finding it... it's just not routing it... let me try some more debugging. [Solved] Routing issue - need to redirect from url parameterized pages to new CodeIgniter nice urls - El Forum - 11-02-2009 [eluser]BrianDHall[/eluser] I ran into that problem to. I was thinking it wasn't working, then I closed my browser and opened a new one after clearing cache. Suddenly it worked, I presume I had a caching issue of some sort. The other issue is the default controller. If you visit the site directly with nothing else defined, it has a tendency to skip routing completely. For that you'll need to use the if($_GET['id']) check on the setting of default controller, and route it appropriately to your rerouted controller. [Solved] Routing issue - need to redirect from url parameterized pages to new CodeIgniter nice urls - El Forum - 11-02-2009 [eluser]ehicks727[/eluser] I actually want to force a server 301 redirect, not just re-route the page... is there any reason I can't do this in the routes.php file? Code: if ($_GET['id']) { It's not working right now, but I haven't cleared my cache, like you mentioned above.. I'll do that next. [Solved] Routing issue - need to redirect from url parameterized pages to new CodeIgniter nice urls - El Forum - 11-02-2009 [eluser]ehicks727[/eluser] [quote author="BrianDHall" date="1257204765"]For that you'll need to use the if($_GET['id']) check on the setting of default controller, and route it appropriately to your rerouted controller.[/quote] That worked.. thanks. I just put this into my default controller and it works great. Thanks for your help, I really appreciate it! Code: if ($_GET['id']) { |