CodeIgniter Forums
Remove controller name for affiliate system - 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: Remove controller name for affiliate system (/showthread.php?tid=38628)

Pages: 1 2


Remove controller name for affiliate system - El Forum - 02-14-2011

[eluser]Rok Biderman[/eluser]
Well, of course... If you use the first parameter routed directly to affiliates, you can't really expect every other route to be automagically recognized. At least i don't think it's possible with routes.php.


Remove controller name for affiliate system - El Forum - 02-16-2011

[eluser]Stoney[/eluser]
You can route every request to one master controller, where you will query the affiliates, and if you find one, you can redirect('affiliates/'.$query_row->id)...
If there is no affiliates found, you can simply redirect it to the existing controller.

I have made language specific (non existing) controllers this way.