title: codeigniter routing functions
body: <p>I have a small problem with routing.</p>
  
  <p>My routes:</p>
  
  <pre><code>$route['category/(:any)/(:num)'] = "site/index/$2"; //not working
  $route['category/(:any)'] = "site/index"; //not working
  $route['category/(:any)/(:any)'] = "site/view/$2"; // working
  $route['Search'] = "site/search"; // working
  </code></pre>
  
  <p>What I want: <a href="http://example.com/category/Home" rel="nofollow">http://example.com/category/Home</a> - call site/index function
  <a href="http://example.com/category/Home/2" rel="nofollow">http://example.com/category/Home/2</a> call site/index function with parameter $2 
  I'm geting 404 erro at those 2 rules. </p>
  
  <p>What I tried was to echo the parameter of category/(:any)/(:num) and it echoed it. This echo was inside the index function. The views adn models exists in the paths I declared. The index page itself wouldn't work without it. So I think the problem has to be in routing</p>
  
  <p>The most interesting thing is that when I change the category/(:any) route to site/view it is working but when I set there site/index it is not working. Even if I set there only site .</p>