codeigniter pagination next page 404 not found
<p>Index page are working well but when i click page 2 it show 404 page not found.</p>

<p>Controller</p>

<pre><code>public function index() {
   $config = array();
   $config['base_url'] = base_url('admin/booking');
   $total_row = $this-&gt;booking_m-&gt;record_count();
   $config["total_rows"] = $total_row;
   $config["per_page"] = 1;
   $config['use_page_numbers'] = TRUE;
   $config['num_links'] = $total_row;
   $config['cur_tag_open'] = '&amp;nbsp;&lt;a class="current"&gt;';
   $config['cur_tag_close'] = '&lt;/a&gt;';
   $config['next_link'] = 'Next';
   $config['prev_link'] = 'Previous';

   $this-&gt;pagination-&gt;initialize($config);

   if($this-&gt;uri-&gt;segment(3)){
     $page = ($this-&gt;uri-&gt;segment(3)) ;
  }
  else{
    $page = 1;
 }


  $data["info"] = $this-&gt;booking_m-&gt;fetch_data($config["per_page"], $page);
  $str_links = $this-&gt;pagination-&gt;create_links();
  $data["links"] = explode('&amp;nbsp;',$str_links );


  $this-&gt;load-&gt;view('admin/booking/index',$data);}
</code></pre>

<p>Page url is <a href="http://127.0.0.1/admin/booking/1" rel="nofollow">http://127.0.0.1/admin/booking/1</a> it work.</p>

<p><a href="http://127.0.0.1/admin/booking/2" rel="nofollow">http://127.0.0.1/admin/booking/2</a> // Not found error</p>

<p>Model </p>

<pre><code>public function fetch_data($limit, $id) {
$this-&gt;db-&gt;limit($limit);
$this-&gt;db-&gt;where('id', $id);
$query = $this-&gt;db-&gt;get("booking");
if ($query-&gt;num_rows() &gt; 0) {
    foreach ($query-&gt;result() as $row) {
    $data[] = $row;
    }

    return $data;
}
return false;
}
</code></pre>