title: Codeigniter passing parameter to controller index
body: <p>I'm building a tutorialsystem with codeigniter and would like to achieve the following URL structure:</p>
  
  <ul>
  <li>/tutorials --> an introduction page with the list of all the categories</li>
  <li>/tutorials/{a category as string} --> this will give a list of tutorials for the given category, e.g. /tutorials/php</li>
  <li>/tutorials/{a category as string}/{an ID}/{tutorial slug} --> this will show the tutorial, e.g. /tutorials/php/123/how-to-use-functions</li>
  <li>/tutorials/add --> page to add a new tutorial</li>
  </ul>
  
  <p>The problem is that when I want to use the first two types of URLs, I'd need to pass parameters to the index function of the controller. The first parameter is the optional category, the second is the optional tutorial ID. I've did some research before I posted, so I found out that I could add a route like <code>tutorials/(:any)</code>, but the problem is that this route would pass <code>add</code> as a parameter too when using the last URL (/tutorials/add).</p>
  
  <p>Any ideas how I can make this happen?</p>