CodeIgniter Forums
Query String Problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Query String Problem (/showthread.php?tid=30494)



Query String Problem - El Forum - 05-17-2010

[eluser]BradEstey[/eluser]
In my routes.php file I have the following:

Code:
$route['search'] = 'search';
$route[':any'] = 'home';

I have $config['enable_query_strings'] = TRUE; set in my config.php file.

Now when someone goes to http://www.whatever.com/search?q=query it always loads the home controller.

How do I get CodeIgniter to remove "?q=whatever" when it looks for the correct route?

This is a particularly huge problem when users come in from Google Adwords, because it places a "?gclid=" query string on every URL for tracking. I would just want it to be ignored by the routing.


Query String Problem - El Forum - 05-17-2010

[eluser]BradEstey[/eluser]
Nevermind... changed $config['uri_protocol'] = "AUTO"; to $config['uri_protocol'] = "PATH_INFO"; ... fixed everything.