$config['suffix'] = '?'.http_build_query($_GET, '', "&");
I am using codeigniter's pagination class for a function in the controller that uses a get post. Everything works fine. The links are produced and I can go to every page etc. But when I click first it take me to the url: http://www.example.com/controller/function/ and ignores the suffix I asked it to append at the end of the function. For example, when 2 is my current page and I hit 1 it does not work: 1,2,4,5,6,... When it automatically takes me to the first link, i.e. page 1 it all works fine though.
Edit:
$this->load->library('pagination');
$config['suffix'] = '?'.http_build_query($_GET, '', "&");
$config['base_url'] = 'http://www.example.com/controller/function';
$config['total_rows'] = count($results);
$config['per_page'] = 15;
$config['num_links'] = 3;
$this->pagination->initialize($config);
So, I am using the get to build the query that the user previously submitted (it's a search function - so the get is necessary) and not to get the number of the page! Hope that this is clearer.