mercredi 29 avril 2015

PHP Slim API 404 not found

I'm trying to create an API using php and php slim.

my folder structure:


  • app -> app.js
  • libs -> Slim
  • v1 -> .htaccess and index.php


RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ %{ENV:BASE}index.php [QSA,L]


require '.././libs/Slim/Slim.php';

$app = new \Slim\Slim();
$app = \Slim\Slim::getInstance();

$app->get('/orderoverview/:customerID', function ($customerID) {
        echo "Hello " . $customerID;


This should be easy but every time I go to http://localhost/api/v1/orderoverview/2 I get a 404 Page Not Found.

BUT when I go to http://localhost/api/v1/index.php/orderoverview/2 I do get the result I want to become!

Any remarks or solutions?

Aucun commentaire:

Enregistrer un commentaire