Routing with slim does not work

3

I'm trying to use Slim FrameWork by following documentation for the same, I configured mod_rewrite and installed mcryp;

If I call http://localhost/slim/books I have: Not Found

If I call http://localhost/frame/index.php?books it works!

What could that be.

This happens for the slim and flight , but not for Laravel .

Here's my .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php [QSA]

I'm using:

Apache / 2.4.10 (Ubuntu 14.04)

PHP Version 5.5.15RC1

Does anyone know what it could be?

    
asked by anonymous 23.07.2014 / 04:11

2 answers

1

Your htaccess rewrites the URL without passing any parameters. Try this:

RewriteRule ^(.*)$ /index.php?$1 [QSA]
    
23.07.2014 / 04:59
0

Assuming that /frame is the root URI of your application - that is, the location relative to the document root where the file index.php which initializes the Slim application - and that the rewriting rule expressed in .htaccess is

RewriteRule ^ index.php [QSA,L]

The correct URL should be http://localhost/frame/books .

    
26.01.2015 / 23:44