We can add custom routing urls in CodeIgniter.
Just open application/config/routes.php and edit the entries which you need to modify.
This file contains the routes array which redirects us to the different urls.
We can change the actual routing url to anything we like.
For example suppose I have a controller named 'pages' with a function 'show' to serve the pages to the user. So normally, calling 'index.php/pages/show' will be the working url which serve a page. It can be changed to anything you wish like index.php/showThePage which still work like the above url.
To do that, just add the following in routes.php:
$routes['showThePage'] = 'pages/show';
The entry inside the routes array will direct the user to the actual url without showing the actual url.
No comments:
Post a Comment