title: PHP Slim Framework: The requested URL was not found on this server
body: <p>For one of the projects, i am using Slim Framework <a href="http://www.slimframework.com/" rel="noreferrer">http://www.slimframework.com/</a> to create restful APIs in PHP. </p>
  
  <p>I did a manual install for the framework by copying it in the PHP project folder using instructions at <a href="https://github.com/slimphp/Slim" rel="noreferrer">https://github.com/slimphp/Slim</a>. </p>
  
  <p>Later i updated my .htaccess as well. </p>
  
  <p>For my project, I have the following Directory Structure</p>
  
  <pre><code>project\
  ----slim\
  ----tests\
  ----index.php
  ----.htaccess
  </code></pre>
  
  <p>For this, the Get call i.e. <a href="http://someIp/project/" rel="noreferrer">http://someIp/project/</a> works for me. It fetches the standard "Welcome to Slim! Congratulations! Your Slim application is running. If this is your first time using Slim, start with this "Hello World" Tutorial."
  However, post/patch/delete and other get are not working. Not even get for hello. It gives the not found error.</p>
  
  <p><a href="http://someIp/project/hello/:name" rel="noreferrer">http://someIp/project/hello/:name</a>
  The requested URL /project/hello/:name was not found on this server.</p>
  
  <p><a href="http://someIp/project/post" rel="noreferrer">http://someIp/project/post</a>
  The requested URL /project/post was not found on this server.</p>
  
  <p>Updated my .htaccess file as :</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /project/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^ index.php [QSA,L]
  </code></pre>
  
  <p>Still it is failing.</p>
  
  <p>When i made changes into the apache config file to allowOverride = all, it failed even for the GET call on index.php. For sure, it is not mapping from .htaccess. </p>
  
  <p>I am still clueless what changes i need to make to .htaccess or any other file to get it working. </p>
  
  <p>Here is the code: </p>
  
  <p>
  
  <pre><code>\Slim\Slim::registerAutoloader();
  
  /**
   * Step 2: Instantiate a Slim application
   *
   * This example instantiates a Slim application using
   * its default settings. However, you will usually configure
   * your Slim application now by passing an associative array
   * of setting names and values into the application constructor.
   */
  $app = new \Slim\Slim();
  
  /**
   * Step 3: Define the Slim application routes
   *
   * Here we define several Slim application routes that respond
   * to appropriate HTTP request methods. In this example, the second
   * argument for `Slim::get`, `Slim::post`, `Slim::put`, `Slim::patch`, and `Slim::delete`
   * is an anonymous function.
   */
  
  // GET route
  $app-&gt;get(
      '/',
      function () {
          $template = "hi";
          echo $template;
      }
  );
  
  //$app-&gt;get(
  //    '/v1/status/',
  //    function() {
  //        echo "status";
  //    }
  //);
  //
  $app-&gt;get('/hello/:name', function ($name) {
      echo "Hello, $name";
  });
  
  // POST route
  $app-&gt;post(
      '/post',
      function () {
          echo 'This is a POST route';
      }
  );
  
  // PUT route
  $app-&gt;put(
      '/put',
      function () {
          echo 'This is a PUT route';
      }
  );
  
  // PATCH route
  $app-&gt;patch('/patch', function () {
      echo 'This is a PATCH route';
  });
  
  // DELETE route
  $app-&gt;delete(
      '/delete',
      function () {
          echo 'This is a DELETE route';
      }
  );
  
  /**
   * Step 4: Run the Slim application
   *
   * This method should be called last. This executes the Slim application
   * and returns the HTTP response to the HTTP client.
   */
  $app-&gt;run();
  </code></pre>