title: Custom base path for Restler?
body: <p>What's the recommended / supposed way to use a custom base path for Restler when it's not deployed at the root of a domain / subdomain?</p>
  
  <p>My site has its own routing and I'm using <a href="https://github.com/Luracast/Restler" rel="nofollow">Restler</a> 3.0 at here:</p>
  
  <p><a href="http://www.example.com/api/data/movies" rel="nofollow">http://www.example.com/api/data/movies</a></p>
  
  <p>When it routes to <code>/api/data/movies</code>, I'm letting Restler take charge:</p>
  
  <pre><code>class Say {
      function hello($to='world') {
          return "Hello $to!";
      }
      function hi($to) {
          return  "Hi $to!";
      }
  }
  
  use Luracast\Restler\Restler;
  $r = new Restler();
  $r-&gt;addAPIClass('Say', '/api/data/movies/say');
  $r-&gt;handle();
  </code></pre>
  
  <p>However, somehow it's not getting the parameters passed to it via sub-path. See below.</p>
  
  <h2>example.com/api/data/movies/say/hi</h2>
  
  <pre><code>{
      "error": {
          "code": 400,
          "message": "Bad Request: `to` is required."
      },
      "debug": {
          "source": "Validator.php:366 at validate stage",
          "stages": {
              "success": [
                  "get",
                  "route",
                  "negotiate"
              ],
              "failure": [
                  "validate",
                  "message"
              ]
          }
      }
  }
  </code></pre>
  
  <h2>example.com/api/data/movies/say/hi/Jim</h2>
  
  <pre><code>{
      "error": {
          "code": 404,
          "message": "Not Found"
      },
      "debug": {
          "source": "Routes.php:431 at route stage",
          "stages": {
              "success": [
                  "get"
              ],
              "failure": [
                  "route",
                  "negotiate",
                  "message"
              ]
          }
      }
  }
  </code></pre>
  
  <p>I tried to Google but found nothing relevant to my problem. How can I make it work? What's the recommended / supposed way to use Restler under a sub-directory-URL instead of a domain / sub-domain root?</p>