Page 1 of 1

[CI]URL parameter in Codeigniter separated by slashes

Posted: Wed Jun 11, 2014 2:54 am
by babyskill
In my project, I am passing parameters through URL like,

http://site.org/project/controllername/ ... &type=free

What I want is to change the URL to

http://site.org/project/controllername/function/1/free

Is there any method to do this in Codeigniter without using htaccess. I tried adding

Code: Select all

$route['(:any)'] = 'controllername/function/$1';
in application/config/routes.php file. But it returned
404 (Page Not Found)
Error.

Can anyone help me to achieve this. Thanks in advance.

Re: [CI]URL parameter in Codeigniter separated by slashes

Posted: Wed Jun 11, 2014 4:35 am
by pbs
you just need to change the config.php file

check this variable, change it to true

Code: Select all

$config['enable_query_strings'] = TRUE;
also check this URL for more details
http://ellislab.com/codeigniter/user-gu ... /urls.html