title: CodeIgniter .htaccess / Mod_rewrite
body: <p>In the past I have solved this problem by creating a new rule for every single controller.
  So here we go;
  By default the url is as below;</p>
  
  <pre><code>http://www.url.com/index.php/controller/method/parameters
  </code></pre>
  
  <p>I want to change this to;</p>
  
  <pre><code>http://www.url.com/controller/method/parameter1/parameter2/parameter3/etc...
  </code></pre>
  
  <p>My problem is the parameters-part as I sometimes have 3 or 4 parameters, but sometimes none or just one.</p>
  
  <p>Right now I have this (which does not work, otherwise I wouldn't post):</p>
  
  <pre><code>RewriteEngine On
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
  </code></pre>
  
  <p>If I request just the controller it works (since an index() method is present), but custom methods and parameters do not work.</p>
  
  <p>Then, do I also have to add routes to the config/routes.php?
  In the past I fixed this problem by adding custom routes and rules for every single used combination.</p>
  
  <p>I google'd for days, no success. Please tell me if I missed a post.</p>
  
  <p>Thanks in advance.</p>