CodeIgniter Forums

Full Version: CI adds extra ? in URL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]CoderReborn[/eluser]
When I redirect to '/respond/85', the URL should read: http://www.mydomain.com/respond/85
But CI creates: http://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!

El Forum

[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

El Forum

[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.