By default as you know that the codeIgniter Url is based on url segments such as given below
http://example.com/index.php/news/local/metro/crime_is_up
The segment numbers would be this:
1.news
2.local
3.metro
4.crime_is_up
Now what if you want a querystrings not a uri segment then what will you do here the uri protocol in the
config file come into picture.
Segment url :- http://example.com/this/is/a/url/segment
Querystring url :- http://example.com/?type=text&message=hello.
Now there are two method of using uri protocol
1. Application - wide
2. Controller Specific
a) First For Application - wide
In system/application/config.php find and modify the following two lines:
//Change from 'AUTO' to 'PATH_INFO' to allow querystrings
$config['uri_protocol'] = 'PATH_INFO';
//Change from 'FALSE' to 'TRUE' to allow querystrings
$config['enable_query_strings'] = TRUE;
b) Controller Specific - This will only affect a single controller and not your entire application
In system/application/config.php find and modify the following line:
//Change from 'AUTO' to 'PATH_INFO' to allow querystrings
$config['uri_protocol'] = 'PATH_INFO';
No comments:
Post a Comment