CodeIgniter Forums
index.php shows error when setting enable_query_strings to True - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: index.php shows error when setting enable_query_strings to True (/showthread.php?tid=62774)



index.php shows error when setting enable_query_strings to True - redjersey - 08-25-2015

in my config.php I have set the enable_query_strings = TRUE

as it will be much easier to display images.

so my url is something like:

localhost/ci/index.php?c=welcome

If I call localhost/ci/index.php?c=welcome or localhost/ci/index.php?c=welcome&m=index it works.

However if I just call:

localhost/ci/index.php or localhost/ci/

I'll have the error message saying

Unable to determine what should be displayed. A default route has not been specified in the routing file.

in my routes.php

$route['default_controller'] = 'welcome';

Please advise


RE: index.php shows error when setting enable_query_strings to True - PaulD - 09-15-2015

May I ask why it would make displaying images easier?

When I first read your question, I thought setting the default controller to '?c=welcome' would work but it won't because you will still have the / added.

Perhaps you need a .htaccess file (if on apache) to redirect a root call through to your c=welcome page. That might do it.

Hope that helps,

Paul.


RE: index.php shows error when setting enable_query_strings to True - Narf - 09-17-2015

https://github.com/bcit-ci/CodeIgniter/issues/4109