title: Add a 'prefix' controller to url in CodeIgniter
body: <p>I currently have an api running on CodeIgniter which can be accessed via <a href="http://mysite.com/controller/method/variable" rel="nofollow">http://mysite.com/controller/method/variable</a>. However, I want to convert the url, adding an 'api' prefix before the controller, leaving the url to look like <a href="http://mysite.com/api/controller/method/variable" rel="nofollow">http://mysite.com/api/controller/method/variable</a>.</p>
  
  <p>I presumed that this is to do with routing, so I added two new routes to the routes.php file:</p>
  
  <pre><code>$route['api/users/auth'] = 'users/auth';
  $route['api/users/create'] = 'users/create';
  </code></pre>
  
  <p>This now adds the 'api' prefix to following urls.</p>
  
  <pre><code>http://mysite.com/api/users/auth
  http://mysite.com/api/users/create
  </code></pre>
  
  <p>But now, the endpoints can still be accessed via a call to the above urls without the 'api' prefix. </p>
  
  <p>How can I prevent this from happening or what would the best way to do this be?</p>