Welcome Guest, Not a member yet? Register   Sign In
Strange (to me) routing behaviour
#4

(12-04-2014, 09:22 PM)lazylazz Wrote: I get a 404 if i try accessing abc.com/hello (which again, I expect).  What I find peculiar though is that if I enter abc.com/example/hi in my browser, I can access the content.  I didn't know that such a thing was possible.  Could someone offer me some insight (even if it's just as simple as  yes... it is possible)?


/hello is not an actual controller, so your route setting told it to use example/hi (controller/method)

Codeigniter by default however will look for a controller with same name

/example/hi codeigniter will go to your example controller and run your hi method because it exists.


(Some frameworks require you set all the routes, Codeigniter will auto match to controller files by name. )
Reply


Messages In This Thread
Strange (to me) routing behaviour - by lazylazz - 12-04-2014, 09:22 PM
RE: Strange (to me) routing behaviour - by Narf - 12-05-2014, 03:50 AM
RE: Strange (to me) routing behaviour - by trentramseyer - 12-06-2014, 04:50 AM
RE: Strange (to me) routing behaviour - by Carman - 12-17-2014, 05:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB