- Human friendly
- Search-engine
- Standard “query string” approach
- Dynamic systems
- Segment-based approach
jayakumar.xyz/codeigniter/docs/urls
URI Segments
It is following MVC Approach
jayakumar.xyz/class/function/ID
- The first segment represents the controller class
- The second segment represents the function (method) class
- The third segment represents the ids, variable or passing any variables class
Removing the index.php file
By default, the index.php file will be included in your URLs:
jayakumar.xyz/index.php/codeigniter/docs/urls
Example: .htaccess file
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
After using .htaccess file default url changed
jayakumar.xyz/codeigniter/docs/urls
Enabling Query Strings
In some cases you might prefer to use query strings URLs:
jayakumar.xyz/index.php?c=products&m=view&id=345
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
jayakumar.xyz/index.php?c=controller&m=method