title: Getting error404 on Ajax in Codeigniter
body: <p>I have problem with my ajax code. I`m trying to increase number inside span on click with ajax, but keep getting error in console - POST <code>localhost/slots/game/lines</code> 404 (Not Found) . Btw, I use Codeigniter.</p>
  
  <p>Here is the code :</p>
  
  <p>PHP (Controller)</p>
  
  <pre><code> &lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  class Game extends CI_Controller {
      function __construct()
      {
          parent::__construct();
      }
      function index(){
      }
      function win()
      {
          $this-&gt;session-&gt;set_userdata( array('win') =&gt; $win);
          $win = $this-&gt;input-&gt;post('win');
      }
      function lines()
      {
          $this-&gt;session-&gt;set_userdata( array('lines') =&gt; $lines);
          $lines = $this-&gt;input-&gt;post('lines');
          echo $lines++;
      }
      function wager(){
          $this-&gt;session-&gt;set_userdata( array('wager') =&gt; $wager);
          $wager = $this-&gt;input-&gt;post('wager');
      }   
  }
  ?&gt; 
  </code></pre>
  
  <p>And here is my Ajax -</p>
  
  <pre><code>function lines()
  {
  var lines = parseInt($('#lines span').html()) + 1;
  $.ajax({
          type: 'POST',
          url: base_url + 'game/lines',
          data: { lines: lines },
          success:function(response){
              if(response &lt;= 8){
                  $('#lines span').html(response);
                  return true;
              }
              else return false;
          }
  
  });
  }
  </code></pre>
  
  <p>And in my HTML I call <code>lines function onclick</code>.I`m using latest xampp as my virtual host.I also have one custom route in CI - <pre>$route['game/(:any)'] = "game/$1";</pre>
  P.S. base_url is defined in JS as variable.</p>