Welcome Guest, Not a member yet? Register   Sign In
Can someone please clarify the querystring fix thing?

1. I've got htaccess rewriting my urls to remove the 'index.php' part.
2. I'm using CI 2.02.

I want to use combined url segments with querystring values, so I can do:

I've just spent an hour reading a couple of huge threads on here. I'm none the wiser.

To clarify what I've done so far, and for the benefit of anyone else who's as confused as I am:

This suggested solution - from 2009 - does still seem to work, in part:

To wit, this solution involves:
1. In config.php, change uri_protocol to PATH_INFO
2. In config.php, change enable_query_strings to TRUE
3. In htaccess, change any instance of "index.php?/$1" to "index.php/$1"

However, this puts question marks on my URLs. As in, site_url('/about_us') now returns "http://www.mysite.com/?/about_us". This results in a redirect loop for me, and bascially doesn't work.

There is another posted solution, at:

However, it seems to just consist of some code to paste into a new file at /applications/libraries/MY_Input.php

class MY_Input extends CI_input {
    function _sanitize_globals() {
        $this->allow_get_array = TRUE;

I guess it was assumed that anyone smart enough to need to use this fix, was smart enough to figure out how. Unfortunately, I'm not.

Specifically, I'm confused regarding:

1. Having created it, do I have to add this new file to my list of libraries in autoload.php? If not, how does it get included?
2. How do I use it? That is; will querystring variables now be available via $_GET, or $this->input->get, or both, or something else?
3. What should my config settings be with this approach? As per the first 'fix', I'm currently enabling query strings and using PATH_INFO as my uri_protocol. Should these be different? Should anything else in config.php be different?
4. Does my htaccess need (a) leaving as it is, (b) reverting to contain question marks, or © something else?

Finally... just... WTF? Querystrings should work. Out of the box, they should just work.

Theme © iAndrew 2016 - Forum software by © MyBB