title: Unable to load a form in codeigniter from a controller
body: <p>I have a simple sign up/Login registration project in php/codeigniter</p>
  
  <p>and I always get this particular error while clicking on the Sign in or the Register button </p>
  
  <p><strong>Error: "The requested URL /CI/user/login was not found on this server."</strong></p>
  
  <p>Here is the Controller file user.php</p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
      class User extends CI_Controller{   
       public function __construct()
       {
  
        parent::__construct();
        $this-&gt;load-&gt;model('user_model');
  
       }
  
       public function index()
  
       {
        if(($this-&gt;session-&gt;userdata('user_name')!=""))
        {
         $this-&gt;welcome();
        }
  
        else{
         $data['title']= 'Home';
         $this-&gt;load-&gt;view('header_view',$data);
         $this-&gt;load-&gt;view("registration_view.php", $data);
         $this-&gt;load-&gt;view('footer_view',$data);
        }}
  
       public function welcome()
       {
        $data['title']= 'Welcome';
        $this-&gt;load-&gt;view('header_view',$data);
        $this-&gt;load-&gt;view('welcome_view.php', $data);
        $this-&gt;load-&gt;view('footer_view',$data);
       }
  
       public function login()
       {
        $email=$this-&gt;input-&gt;post('email');
        $password=md5($this-&gt;input-&gt;post('pass'));
  
        $result=$this-&gt;user_model-&gt;login($email,$password);
        if($result) $this-&gt;welcome();
        else        $this-&gt;index();
       }
  
       public function thank()
       {
        $data['title']= 'Thank';
        $this-&gt;load-&gt;view('header_view',$data);
        $this-&gt;load-&gt;view('thank_view.php', $data);
        $this-&gt;load-&gt;view('footer_view',$data);
       }
  
       public function registration()
       {
        $this-&gt;load-&gt;library('form_validation');
        // field name, error message, validation rules
        $this-&gt;form_validation-&gt;set_rules('user_name', 'User Name', 'trim|required|min_length[4]|xss_clean');
        $this-&gt;form_validation-&gt;set_rules('email_address', 'Your Email', 'trim|required|valid_email');
        $this-&gt;form_validation-&gt;set_rules('password', 'Password', 'trim|required|min_length[4]|max_length[32]');
        $this-&gt;form_validation-&gt;set_rules('con_password', 'Password Confirmation', 'trim|required|matches[password]');
  
        if($this-&gt;form_validation-&gt;run() == FALSE)
        {
         $this-&gt;index();
        }
        else
        {
         $this-&gt;user_model-&gt;add_user();
         $this-&gt;thank();
        }
       }
  
       public function logout()
       {
        $newdata = array(
        'user_id'   =&gt;'',
        'user_name'  =&gt;'',
        'user_email'     =&gt; '',
        'logged_in' =&gt; FALSE,
        );
  
        $this-&gt;session-&gt;unset_userdata($newdata );
        $this-&gt;session-&gt;sess_destroy();
        $this-&gt;index();
       }
      }
      ?&gt;
  </code></pre>
  
  <p>Here is the view file registration_view.php</p>
  
  <pre><code>    &lt;html&gt;
  &lt;div id="content"&gt;
  &lt;div class="signup_wrap"&gt;
  &lt;div class="signin_form"&gt;
  
  
   &lt;?php echo form_open("user/login"); ?&gt;
  
    &lt;label for="email"&gt;Email:&lt;/label&gt;
    &lt;input type="text" id="email" name="email" value=""/&gt;
  
    &lt;label for="password"&gt;Password:&lt;/label&gt;
    &lt;input type="password" id="pass" name="pass" value=""/&gt;
  
    &lt;input type="submit" class="" value="Sign in"/&gt;
  
   &lt;?php echo form_close(); ?&gt;
  
  
  
  
  &lt;/div&gt;&lt;!--&lt;div class="signin_form"&gt;--&gt;
  &lt;/div&gt;&lt;!--&lt;div class="signup_wrap"&gt;--&gt;
  
  
  
  
  
  &lt;div class="reg_form"&gt;
  &lt;div class="form_title"&gt;Sign Up&lt;/div&gt;
  &lt;div class="form_sub_title"&gt;It's free and anyone can join&lt;/div&gt;
  
  
  
  &lt;?php echo validation_errors('&lt;p class="error"&gt;'); ?&gt;
  &lt;?php echo form_open("user/registration");?&gt;
  
    &lt;p&gt;
    &lt;label for="user_name"&gt;User Name:&lt;/label&gt;
    &lt;input type="text" id="user_name" name="user_name" value="&lt;?php echo set_value('user_name'); ?&gt;" /&gt;
    &lt;/p&gt;
  
    &lt;p&gt;
    &lt;label for="email_address"&gt;Your Email:&lt;/label&gt;
    &lt;input type="text" id="email_address" name="email_address" value="&lt;?php echo set_value('email_address'); ?&gt;" /&gt;
    &lt;/p&gt;
  
    &lt;p&gt;
    &lt;label for="password"&gt;Password:&lt;/label&gt;
    &lt;input type="password" id="password" name="password" value="&lt;?php echo set_value('password'); ?&gt;" /&gt;
    &lt;/p&gt;
  
    &lt;p&gt;
    &lt;label for="con_password"&gt;Confirm Password:&lt;/label&gt;
    &lt;input type="password" id="con_password" name="con_password" value="&lt;?php echo set_value('con_password'); ?&gt;" /&gt;
    &lt;/p&gt;
  
    &lt;p&gt;
    &lt;input type="submit" class="greenButton" value="Submit" /&gt;
    &lt;/p&gt;
  
   &lt;?php echo form_close(); ?&gt;
  
  &lt;/div&gt;&lt;!--&lt;div class="reg_form"&gt;--&gt;
  &lt;/div&gt;&lt;!--&lt;div id="content"&gt;--&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>I think the main problem is with form_open ('form');</strong></p>
  
  <p>Here is the htacess file</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
  </code></pre>
  
  <p></p>