To have the URL http://example.com/index.php/show/1
do as you ask you would modify the file application/config/routes.php to accomplish the task.
Assuming show
is a controller and you want the index() method of the controller to handle the above URL you need to do a couple things.
Define the index method to accept an argument
public function index($arg)
{
...
Add the following to application/config/routes.php
$route['show/(:any)'] = 'show/index/$1';
If you want to use some method other than index()
to handle the chore - let's say doShow()
then the route looks like this.
$route['show/(:any)'] = 'show/doShow/$1';
And the method is
public function doShow($arg)
{
...
No matter what method used - index()
or doShow()
- if you don't pass an argument in the second URI segment you will get a 404 - Page Not Found screen.