Why Silex return “The requested URL /home was not found on this server.” error message


It is the first time I play with Silex. I've tried a '/' route, in GET and POST, and all works fine. Now I am trying to make more complex requests:


    require_once __DIR__ . '/../vendor/autoload.php';
    $app = new Silex\Application();
        function () use ($app) {
            return 'Homepage';

"/home" route returns "The requested URL /home was not found on this server.". Why?

This is my .htaccess:

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FIOLNAME} !-f
RewriteRule ^ index.php [L]

"/index.php/home" works

Best Solution

Try index.php/home. If that works you are missing the .htaccess (on Apache).

Take a look here http://silex.sensiolabs.org/doc/web_servers.html

Related Question