title: I get 'page not found' error with Codeigniter and AJAX request
body: <p>I'm developing a project with CodeIgniter but i have a problem when sending request with jQuery AJAX. My default controller is:</p>
  
  <pre><code>$route['default_controller'] = "test";
  </code></pre>
  
  <p>and here is my test controller:</p>
  
  <pre><code>if (!defined('BASEPATH'))
      exit('No direct script access allowed');
  
  class test extends CI_Controller {
  
      function __construct() {
          parent::__construct();
      }
      public function login_with() {
          echo "1";
      }
  }
  </code></pre>
  
  <p>and here is my AJAX request:</p>
  
  <pre><code>$(function() {
      $('#login_with').click(function() {
          $.ajax({
              type: "post",
              url: "&lt;?= base_url('test/login_with') ?&gt;",
              data:"login=1",
              success:function(ajax_success){
                  alert(ajax_success);
              }
          });
      });
  });
  </code></pre>
  
  <p>finally here is my .htaccess file:</p>
  
  <pre><code>DirectoryIndex index.php
  RewriteEngine on
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond $1 !^(index\.php|robots\.txt)
  RewriteRule ^(.*)$ index.php?/$1 [L]
  </code></pre>
  
  <p>What is wrong here? I'm getting 404 page not found error when request has been sent.</p>