Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] How to use URI Segments and Query Strings in the same project
#11

[eluser]renownedmedia[/eluser]
The PATH_INFO option doesn't work with every server configuration. I think its because were allowed to change the three get vars that get assigned e.g. $_GET['c'], using the config file. If these were static, and we specified the rewriting using only a .htaccess file, adding get variables to our app would be a lot less flakey.

Anyone know how kohana does it?
#12

[eluser]prabeen.giri[/eluser]
''
#13

[eluser]prabeen.giri[/eluser]
If you want both of them working. I think its better to use both if we will have to show the search values to the url as query string . Otherwise only using uri segment is ok i think .
Doing this will work as per mentioned above ...

Code:
$config['uri_protocol'] = "PATH_INFO";
$config['enable_query_strings'] = TRUE;
EG.http://something.com/index.php/my_controller/my_function/page/5/?keyword=findme&keyword1=searchme

If you want to retrieve the query string then use
Code:
$this->input->get('keyword')
instead.


CodeIgniter rocks........
#14

[eluser]prabeen.giri[/eluser]
..
#15

[eluser]Jonathan Angel[/eluser]
If you get 302 or 404 erros, you may need to modify your .htaccess file. Remove the question mark from the following rewriterule where it occurs:

RewriteRule ^(.*)$ /index.php?/$1 [L]

becomes

RewriteRule ^(.*)$ /index.php/$1 [L]




Theme © iAndrew 2016 - Forum software by © MyBB