title: code igniter HMVC + REST setup
body: <p>i have already set up a HMVC (i learned my setup from <a href="https://www.youtube.com/channel/UCkzjsv1ymTmdGpWTtZ7nM5A/videos" rel="nofollow">https://www.youtube.com/channel/UCkzjsv1ymTmdGpWTtZ7nM5A/videos</a> ) and using it on my program. but i need it to re-code it into a RESTful type. </p>
  
  <p>i have a <code>MY_Controller.php</code> file </p>
  
  <pre><code>&lt;?php
  
  class MY_Controller extends MX_Controller {
  
      function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;module('Templates');
          $this-&gt;load-&gt;module('Login');
  
      }
  
  }
  
  ?&gt; 
  </code></pre>
  
  <p>this file is for loading modules easily. now i try to set up my REST_Controller etc. i have a folder like this</p>
  
  <pre><code>application
  - - modules
  - - - - Rest
  - - - - - - controller
  - - - - - - - Api.php
  - - - - - - libraries
  - - - - - - - Rest_Controller.php
  - - - - - - - Format.php
  - - - - - - config
  - - - - - - - rest.php
  - - - - - - models
  - - - - - - views
  </code></pre>
  
  <p>i edited my <code>REST_Controller.php</code> from</p>
  
  <pre><code>abstract class REST_Controller extends CI_Controller {
  </code></pre>
  
  <p>into</p>
  
  <pre><code>abstract class REST_Controller extends MY_Controller {
  </code></pre>
  
  <p>and my <code>Api.php</code> is, </p>
  
  <pre><code>&lt;?php 
  defined('BASEPATH') OR exit('No direct script access allowed');
  
  require APPPATH.'modules/Rest/libraries/REST_Controller.php';
  
  class Api extends REST_Controller {
      function __construct() {
          parent::__construct();
      }
  
      function student_get(){
          $this-&gt;response('My first API response');
      }
  }
  </code></pre>
  
  <p>but when i do <code>http://localhost/FOLDERNAME/Api/student_get</code> on my browser</p>
  
  <p>i got an error</p>
  
  <pre><code>404 Page Not Found
  
  The page you requested was not found.
  </code></pre>
  
  <p>also i found this REST on mvc tutorial, it says that if i go to <a href="http://myapi.com/" rel="nofollow">http://myapi.com/</a> it should open your codeigniter page, and it is good. but i only got </p>
  
  <pre><code>Buy this domain
  The domain myapi.com may be for sale by its owner! etc.
  </code></pre>
  
  <p>i use <code>Phil Sturgeon's REST Library</code> by the way</p>
  
  <p>im still not sure if what im doing is right. can someone please tell me what the error is or how i can do it correctly. thanks</p>