At some point, you might want to alter how CodeIgniter handles the routing of URLs to controllers. By default, CodeIgniter splits a URL into several different parts. You obviously have the domain section of the URL (www.domain.com
), but after that there are (usually, but not always) up to three more items, each separated by a forward slash. The first item is the controller, the second is the function (or method, if you want) in the controller, and the third is a parameter that you will pass to the function in the controller.
So, a standard URL in CodeIgniter might look like www.domain.com/users/edit/1
. So, user number 1
is being edited using the edit
function in the users
controller--that seems simple enough and I'm sure you're familiar with it.
However, there may be times when you wish this to change. It is possible to alter what is displayed in the URL in the web browser's address bar to show something different from controller/function/data
. It is...