Slim routing does not work

Asked

Viewed 578 times

3

I’m trying to use the Slim Framework following the documentation for the same, configured mod_rewrite and installed mcryp;

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

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

What could that be.

This happens to the slim and Flight, but it does not happen to the Laravel.

Here 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?

  • 2

    The address is localhost/slim or /frame?

2 answers

1

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

RewriteRule ^(.*)$ /index.php?$1 [QSA]
  • Friend, unfortunately it didn’t work!!

0

On the assumption that /frame is the root URI of its implementation - that is, the place, relating to the Document root where the file is index.php which initializes the Slim application - and which the rewriting rule expresses in .htaccess is

RewriteRule ^ index.php [QSA,L]

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.