Q:

CodeIgniter unexpectedly redirects to 404 page

I am trying to make search engine but when I click on search button it goes to 404 page. Here is my view:
<aside class="widget">
    <h5>SEARCH BLOG</h5>
    <form class="form-inline search" role="search" action="<?php echo site_url('blog/search/');?>" method = "post">
      <div class="form-group">
        <div class="input-group">
          <input name="search" type="text" class="form-control" id="search" placeholder="Search">
          <div class="input-group-addon">
            <button  type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
          </div>
        </div>
      </div>
    </form>
</aside> 

Here is my model: 
function blog_search($keyword) {

    $this->db->select('*');
    $this->db->from('news');
    $this->db->like('title_rus',$keyword);
    $this->db->like('body_rus',$keyword);
    $query = $this->db->get();
    return $query->result();

}

Here is my controller:
function search() {

    $keyword = $this->input->post('search');

    $data['random_courses'] = $this->courses_model->get_random_course();
    $data['category'] = $this->news_model->get_category_for_sidebar ();
    $data['blog'] = $this->news_model->blog_search($keyword);
    echo '<pre>';
    print_r($data['blog']);
    echo '</pre>'; die();

    $this->load->view('templates/header');
    $this->load->view('blog/blog', $data);
    $this->load->view('templates/footer');
}

A:

Change $route["blog/search/(:any)"] = 'blog/search/$1' to $route["blog/search"] = 'blog/search' and try again. I don't think query param will count as (:any) in your routes.

