title: Symfony2 : 404 Not Found without app.php
body: <p>This is my htaccess in public_html directory :</p>
  
  <pre><code>DirectoryIndex app.php
  
  &lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
      RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
      RewriteRule ^(.*) - [E=BASE:%1]
  
      RewriteCond %{HTTP:Authorization} .
      RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  
      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]
  &lt;/IfModule&gt;
  
  &lt;IfModule !mod_rewrite.c&gt;
      &lt;IfModule mod_alias.c&gt;
          RedirectMatch 302 ^/$ /app.php/
      &lt;/IfModule&gt;
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>And this is /etc/apache2/sites-available/mydomain_com.conf :</p>
  
  <pre><code>&lt;VirtualHost *&gt;
          ServerAdmin webmaster@mydomain.com
          ServerName  mydomain.com
          ServerAlias www.mydomain.com
  
          # Indexes + Directory Root.
          DocumentRoot /home/myuser/domains/mydomain.com/public_html
          # DirectoryIndex app.php
          &lt;Directory /home/myuser/domains/mydomain.com/public_html&gt;
              AllowOverride All
              Order allow,deny
              Allow from All
          &lt;/Directory&gt;
  
          # CGI Directory
          ScriptAlias /cgi-bin/ /home/myuser/domains/mydomain.com/cgi-bin/
          &lt;Location /cgi-bin&gt;
                  Options +ExecCGI
          &lt;/Location&gt;
  
  
          # Logfiles
          ErrorLog  /home/myuser/domains/mydomain.com/log/error.log
          CustomLog /home/myuser/domains/mydomain.com/log/access.log combined
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>And these are results :</p>
  
  <ul>
  <li><strong>mydomain.com</strong> => Redirects to <strong>mydomain.com/app.php/</strong> and then works fine.</li>
  <li><strong>mydomain.com/post/</strong> => 404 Not Found</li>
  <li><strong>mydomain.com/app.php/post/</strong> => works fine.</li>
  </ul>
  
  <p>Any idea ?</p>