Welcome Guest, Not a member yet? Register   Sign In
Using Default Routes with an ID as the first segment.
#1

[eluser]tonybianco[/eluser]
Hi there. I'm new to CI but not so much to MVC. I have done some stuff with Rails and a few other frameworks. However, I'm running into a wall trying to figure out the routing of urls.

I'm wanting to set up a default route so that when someone types up mydomain.com/45678 <--(as in an affiliate id) then it will route to the proper controller and action with the numbers as the the id of the affiliate.

I spent time digging around the documentation but I couldn't find a way to do that for me. I was thinking that if I did this that it would work:
Code:
$rout['(:num)'] = "affiliates/affiliate_lookup/$1";

But it doesn't work nor does it even feel right when I'm coding that. Any suggestions would be very helpful?


Messages In This Thread
Using Default Routes with an ID as the first segment. - by El Forum - 11-09-2008, 07:36 PM
Using Default Routes with an ID as the first segment. - by El Forum - 11-09-2008, 07:43 PM
Using Default Routes with an ID as the first segment. - by El Forum - 11-09-2008, 08:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB