title: Slim Framework - 404 Page Not
body: <p>I came across Slim framework and have been playing with it. I'm running into a 404 issue. With the code below: I know this has something to do with the url but I'm not quite sure how to fix this problem. Do I have to define the url for "profiles" somewhere? </p>
  
  <p>also my directories look like this:</p>
  
  <p>include</p>
  
  <ul>
  <li><p>dbhandler.php</p></li>
  <li><p>config.php</p></li>
  <li>dbConnect.php</li>
  </ul>
  
  <p>lib</p>
  
  <ul>
  <li>Slim</li>
  </ul>
  
  <p>v1</p>
  
  <ul>
  <li>.htaccess</li>
  <li>index.php</li>
  </ul>
  
  <p>Problem in this code: mysite.com//parentfolder/v1/profiles throws 404 error</p>
  
  <pre><code>$app-&gt;post('/profiles', 'authenticate', function() use ($app) {
              // check for required params
              verifyRequiredParams(array('gender'));
  
              $response = array();
              $gender = $app-&gt;request-&gt;post('gender');
  
              global $user_id;
              $db = new DbHandler();
  
              // creating new task
              $profile_id = $db-&gt;createUserProfile($user_id, $gender);
  
              if ($profile_id != NULL) {
                  $response["error"] = false;
                  $response["message"] = "Profile created successfully";
                  $response["profile_id"] = $profile_id;
                  echoRespnse(201, $response);
              } else {
                  $response["error"] = true;
                  $response["message"] = "Failed to create profile. Please try again";
                  echoRespnse(200, $response);
              }            
  });
  </code></pre>
  
  <p>.htaccess</p>
  
  <pre><code>RewriteEngine On 
  
  RewriteCond %{REQUEST_FILENAME} !-f 
  
  RewriteRule ^(.*)$ %{ENV:BASE}index.php [QSA,L]
  </code></pre>
  
  <p>I also have this function that works just fine.</p>
  
  <pre><code>$app-&gt;post('/register', function() use ($app) {
              // check for required params
              verifyRequiredParams(array('name', 'email', 'password'));
  
              $response = array();
  
              // reading post params
              $name = $app-&gt;request-&gt;post('name');
              $email = $app-&gt;request-&gt;post('email');
              $password = $app-&gt;request-&gt;post('password');
  
              // validating email address
              validateEmail($email);
  
              $db = new DbHandler();
              $res = $db-&gt;createUser($name, $email, $password);
  
              if ($res == USER_CREATED_SUCCESSFULLY) {
                  $response["error"] = false;
                  $response["message"] = "You are successfully registered";
              } else if ($res == USER_CREATE_FAILED) {
                  $response["error"] = true;
                  $response["message"] = "Oops! An error occurred while registereing";
              } else if ($res == USER_ALREADY_EXISTED) {
                  $response["error"] = true;
                  $response["message"] = "Sorry, this email already existed";
              }
              // echo json response
              echoRespnse(201, $response);
          });
  </code></pre>