CodeIgniter Forums
The Router Issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: The Router Issue (/showthread.php?tid=62611)



The Router Issue - tjnuchen - 08-04-2015

Dear all,

I have a probelm during development with CI 3.0.0.

In config.php, if I set $config['enable_query_strings'] = TRUE; when I visit my index page that is in localhost website(http://huo.zaiwai.com/vote/) , it has the error:
Unable to determine what should be displayed. A default route has not been specified in the routing file.

But when I set  $config['enable_query_strings'] = FALSE, the problem is resolved however I can't pass the parameter with url.

So how can I resolve this?

Thank you

BR.


RE: The Router Issue - mwhitney - 08-05-2015

First, you probably need to review the docs for the enable_query_strings setting:
http://www.codeigniter.com/user_guide/general/urls.html#enabling-query-strings

So, if you have it set to TRUE, your URL would look something like http://huo.zaiwai.com/index.php?c=vote

If you set it to FALSE, you can pass parameters as segments of the URL, rather than using query strings. The page which documents the enable_query_strings setting also goes into a little information about this, but the documentation on Controllers goes into further detail: http://www.codeigniter.com/user_guide/general/controllers.html#passing-uri-segments-to-your-methods