I have the following routing system in my
http://localhost/myproject/controller.
When I filtring records using categoryid that have in second segment like:
http://localhost/myproject/controller/id.
I have a routing like this:
$route['routingcontroller/(:any)'] = 'controller/index/$1';
How my controller looks like
public function index()
{
// Which records we want
$id = $this->uri->segment(2);
// Pagination starts
$config['base_url'] = base_url().'routingcontroller/'.$id;
$config['total_rows'] = $this->Product_model->count_total_records($id);
$config['per_page'] = 12;
// Customization
$config['uri_segment'] = 2;
$config['num_links'] = 2;
//$config['use_page_numbers'] = TRUE;
$config['enable_query_strings'] = TRUE;
$config['page_query_string'] = TRUE;
$config['query_string_segment'] = 'per_page';
if ($this->uri->segment(2)) {
$offset = $this->uri->segment(2);
} else {
$offset = 0;
}
$this->pagination->initialize($config);
$data['configure'] = $this->Home_Model->configures();
$data['main_menu'] = $this->Home_Model->main_menu();
$data['social_media'] = $this->Home_Model->social_media();
$data['testimonials'] = $this->Home_Model->testimonials();
$data['category'] = $this->Product_model->category();
$data['products'] = $this->Product_model->products($id, $config['per_page'], $offset);
$data['main_content'] = 'viewfile';
$this->load->view('includes/template', $data);
}
When I click pagination links that is display like
http://localhost/myproject/id/pageno
Then I get an error message like this:
404 Page Not Found