mercredi 29 avril 2015

Wamp, SlimPHP and Htacess

I am having issues with getting Slim to recognize the following:

$app = new \Slim\Slim();

$app->get('/', function () {
    echo "Hello";
});

$app->get('/:name', function () {
    echo "Hello";
});

$app->run();

It will see the first route just fine, how ever the second one returns a

Not Found

The requested URL /image-uploader/gg was not found on this server.

Which lead me to believe I didnt have the re-write mod enabled in wamp. So I enabled it and set AllowOverride to All

I then restarted wamp and visited localhost/image-uploader/ and I get Hello, how ever visiting the second route gives the error above.

Why? My htaccess is as such:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule index.php [L]
</IfModule>

Aucun commentaire:

Enregistrer un commentaire