title: Codeigniter routing and REST server
body: <p>I'm trying to achieve the following URLs for my API (I'm using Codeigniter and Phil Sturgeon's <a href="https://github.com/philsturgeon/codeigniter-restserver" rel="nofollow">REST server library</a>):</p>
  
  <pre><code>/players            -&gt; refers to index method in the players controller
  /players/rookies    -&gt; refers to rookies method in the players controller
  </code></pre>
  
  <p>I don't want the URL to have a trailing "index"</p>
  
  <pre><code>/players/index
  </code></pre>
  
  <p>This is no problem at all when I define the routes like so:</p>
  
  <pre><code>$route['players'] = 'players/index';
  </code></pre>
  
  <p>Everything works as expected.</p>
  
  <p>My problem is that I need additional URL segments like so:</p>
  
  <pre><code>/players/rookies/limit/10/offset/5/key/abcdef
  </code></pre>
  
  <p>The above example works, but the following does not:</p>
  
  <pre><code>/players/limit/10/offset/5/key/abcdef
  </code></pre>
  
  <p>I'm getting the following error: <code>{"status":false,"error":"Unknown method."}</code>
  Obviously there is no <code>limit</code> method in my controller.</p>
  
  <p>How do I have to setup my routes.php config file to get these URLs to work properly?</p>
  
  <p>Any help is much appreciated!</p>