I’m trying to use personal URLs through the code of my application that function the same way as www.facebook.com/namehere (on my application www.website.com/identifier). How would you set this up in routes to be dynamic? So that if /identifier was not an existing controller (/login, /admin, /howitworks, /about are all taken) it runs a function and uses the identifier to query a database?
I’ve tried reading up on routing but I can’t seem to get this working.
Just follow this url Codeigniter’s url routing and __remap()
If your
controllercontains a function named_remap(), it will always get called regardless of what your URI contains. It overrides the normal behavior in which the URI determines which function is called,allowing you to define your own function routing rules.Documentation of
CIis very good, it will teach you everything in a very simple and elegent way.