URL structure

URI segments

The segments in the URL usually represent:

example.com/controller/method/ID
  1. The first segment represents the controller class that should be called.
  2. The second segment represents the class method that should be called.
  3. The third, and any additional segments, represent the ID and any variables that will be passed to the controller.

The URI class contains functions that make it easy to work with your URI data.

If your controller is located in a folder or sub-folders, you may include it in he URL:

example.com/folder1/folder2/controller/method/ID

Query strings

You may also include query strings in the URL:

example.com/controller/method/ID?name=John&age=20

Removing the index.php file

By default, the index.php file may be included in your URLs:

example.com/index.php/controller/method/ID

You may easily remove it by editing "application/config.php" file and changing this code:

$config['index_page'] = 'index.php';

To this one:

$config['index_page'] = '';