CI adds extra ? in URL - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: CI adds extra ? in URL (/showthread.php?tid=50506) |
CI adds extra ? in URL - El Forum - 03-28-2012 [eluser]CoderReborn[/eluser] When I redirect to '/respond/85', the URL should read: www.mydomain.com/respond/85 But CI creates: www.mydomain.com/?/respond/85 The page is displayed correctly, but the URL is ugly. Bad for link sharing with others. How do I fix this? Note: - $config['enable_query_strings'] is set to TRUE in the config.php file - I've setup the following URI route rule: $route['respond/(.+)'] = "respond/index/id/$1"; Thanks! CI adds extra ? in URL - El Forum - 03-28-2012 [eluser]CodeIgniteMe[/eluser] Why do you have $config[‘enable_query_strings’] set to TRUE? Do you need query strings? If not, you can safely set it to FALSE CI adds extra ? in URL - El Forum - 03-28-2012 [eluser]CoderReborn[/eluser] Ok - I changed $config[‘enable_query_strings’] back to FALSE and that resolved the issue. But I do need query strings occasionally. So I just retrieve them from the $_GET array directly instead of using the CI->input class. |