You can define a custom route in config / routes.php , for example:
$route['entradas'] = 'blog/entradas';
Entonces, http://example.com/entradas
Va a http://example.com/blog/entradas
In other words more explained:
There is a file where we can generate all kinds of rules to get a URI routing different from the default. We can find that file in the directory of configuration files:
system/application/config/routes.php
There we can define a array called $ route where we will place all the routing rules that we want to create specifically in our web application CodeIgniter .
If we open the aforementioned file we can see that there are already two routing values defined in the array $ route .
$route['default_controller'] = "welcome";
$route['scaffolding_trigger'] = "";
These two routing values are specific to CodeIgniter and are reserved for any other use. We can change the default routing values for those variables, but we can not create routes for our application by using them. In addition these two predetermined routes must appear before any other route that we define later in the file routes.php .
Nota: El primero de ellos, default_controller, sirve para definir el controlador por defecto que se ejecutaría en caso que no se indique ninguna ruta en la URL (en la raíz del dominio). En la configuración que viene en la instalación básica de CodeIgniter, si no se específica nada en la URL, se abre el controlador "welcome", pero ese controlador predeterminado lo podemos cambiar según nuestras necesidades.
Al hablar de controladores ya se comentó qué era el controlador por defecto y cómo podemos cambiarlo. Ahora ya sabemos que ese cambio de controlador predeterminado en realidad no era más que la definición de una regla de enrutado en CodeIgniter.
Then, to create our own rules, it would be simply to assign new values to the associative array $ route and for that we have to pay attention to the following syntax:
$ route ['de_donde_vienes'] = 'a_donde_vas';
As you can see, in the routes we have two parts:
In the index of the associative array, ' de_donde_vienes ', we place a pattern that must match for a routing to occur.
In the value assigned to that index of the array, ' a_donde_vas ', we place the path to which we are sending the execution flow of CodeIgniter .
Now let's see an example of real routing:
$route['entradas'] = "empresa/tecnologia/5";
More examples Here