.htaccess 从ci中删除index.php后,代码无法正常工作

.htaccess 从ci中删除index.php后,代码无法正常工作,.htaccess,codeigniter,.htaccess,Codeigniter,我用ci和wamp创建了一个简单的登录表单。通过在.htaccess中编写以下代码,我从URL中删除了index.php:- <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php/$1 [L]

我用ci和wamp创建了一个简单的登录表单。通过在.htaccess中编写以下代码,我从URL中删除了index.php:-

             <IfModule mod_rewrite.c>
              RewriteEngine On
              RewriteCond %{REQUEST_URI} ^system.*
              RewriteRule ^(.*)$ /index.php/$1 [L]
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME} !-d
              RewriteRule ^(.*)$ index.php/$1 [L]
              </IfModule>
从URL中删除index.php之前,代码工作正常,但现在只加载第一个视图(登录页面),单击提交按钮后,它将重定向到同一视图,即登录页面。
请帮助我“index/Home/xyz”-“index”应该在URL中吗?不,不应该在那里。事实上,我曾经试过,因为我认为它可能会起作用。但事实并非如此。
       <form method = "post" action = "<?php echo site_url(); ?>Home/xyz">
            <div class = "row" align ="center">
                <?php if($error=$this->session->flashdata('Login_failed')) { ?>

                <div class="alert alert-danger">
                    <?php echo $error; ?>
                </div>
                <?php } ?>
                <?php if($error=$this->session->flashdata('already_existing')) { ?>

                <div class="alert alert-danger">
                    <?php echo $error; ?>
                </div>
                <?php } ?>
                <?php if($error=$this->session->flashdata('logged_out')) { ?>

                <div class="alert alert-info">
                    <?php echo $error; ?>
                </div>
                <?php } ?>
            <div class="col-md-3">
            <label for = "emailid"><em>EMAIL_ID</em></label>
            <input type = "email" name = "eid"  class = "form-control" placeholder = "Enter Email id" value = "<?php if(($this->input->post('submit'))&&($this->input->post('eid'))){echo $this->input->post('eid'); } ?>" required = "required"><br>
            </div>

            <div class="col-md-3">
            <label for = "password"><em>Password</em></label>
            <input type = "password" name = "pass" class = "form-control" placeholder = "Enter password" required="required"><br>
            </div>
             <div class = "col-md-3">
            <label for = "password"></label>
            <input type="submit" class = "btn btn-primary" name = "submit" value = "Sign_in"><br>
        </div>
          </div>



</form>
       class Home extends CI_Controller{

 function __construct() {
parent::__construct();
$this->load->model('Test');
$this->load->library('session');
  }

public function index(){
    $this->load->view('login');
}
public function logout()
{
    $this->Test->updation1();
    $this->session->unset_userdata('usr_sess');
    $this->session->sess_destroy();

}   
public function xyz(){ 
    if($this->input->post('submit')){
        $uid = $this->input->post('eid');
        $pass = $this->input->post('pass');
        $login_id = $this->Test->login($uid,$pass);
        $sess_ary = array('lgid' => $login_id['id'] );
        $this->session->set_userdata('usr_sess',$sess_ary);
        if($login_id)
         {   if($login_id['toggle']==0) 
              {   

                  $this->Test->updation();
                  return $this->load->view('logout');
               }
              else{
                $this->logout();
                $this->session->set_flashdata('already_existing','This account is already logged 
                                                                                               in');
                return $this->load->view('login');      
              }

         }
        else
        {
            $this->session->set_flashdata('Login_failed','Invalid Username/Password');
            return $this->load->view('login');
        }
    }
    else if($this->input->post('logout'))
    {   if($this->session->has_userdata['usr_sess']['lgid']){
           $this->logout();
           $this->session->set_flashdata('Logged_out','Logged out successfully');
           return $this->load->view('login');}
        else{
            return $this->load->view('login');
        }   
    }
}