title: Heroku silex route show 404 except "/"
body: <p>This piece of code was from an example at heroku. But except the route /, anything else I add does not work. It shows 404:</p>
  
  <blockquote>
    <p>The requested URL /e was not found on this server.</p>
  </blockquote>
  
  <pre><code>$app-&gt;match('/', function(Symfony\Component\HttpFoundation\Request $request) use ($app) {
      return $app['twig']-&gt;render('index.twig');
  });
  
  $app-&gt;match("/dump", function(Symfony\Component\HttpFoundation\Request $request) use ($app) {
      return new Response('Thank you for your feedback!', 201);
  })-&gt;bind("dump");
  $app-&gt;get("/t", function() use ($app) {
      return new Response('Thank you for your feedback!', 201);
  })-&gt;bind("t");
  $app-&gt;get("/d", function() {
      return new Response('Thank you for your feedback!', 201);
  })-&gt;bind("d");
  $app-&gt;get("/e", function() {
      return new Response('Thank you for your feedback!', 201);
  });
  $app-&gt;run();
  </code></pre>
  
  <p><strong>Edit 1</strong>
  I deployed it directly on heroku server (heroku auto build on each push to master branch)</p>
  
  <p><strong>Edit 2</strong>
  my workspace:</p>
  
  <pre><code>bin\worker.php
  www\index.php &lt;== the snippet is from this file
  www\list.php
  apache_app.conf
  app.php  &lt;== basic init, return Silex\Application $app
  Procfile
  </code></pre>
  
  <p>The content of <code>apache_app.conf</code> is copied from <a href="https://devcenter.heroku.com/articles/custom-php-settings#web-server-settings" rel="nofollow noreferrer">this link</a>.
      RewriteEngine On</p>
  
  <pre><code>RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
  RewriteRule ^(.*) - [E=BASE:%1]
  
  RewriteCond %{ENV:REDIRECT_STATUS} ^$
  RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
  
  RewriteCond %{REQUEST_FILENAME} -f
  RewriteRule .? - [L]
  
  RewriteRule .? %{ENV:BASE}/app.php [L]
  </code></pre>
  
  <p>I figured that I need to change the apache config somehow, but I don't understand htaccess syntax.</p>