# Use the front controller as index file. It serves as fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# startpage (path "/") because otherwise Apache will apply the rewritting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex app.php
<IfModule mod_rewrite.c>
#RewriteEngine On
#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]
# Rewrite all other queries to the front controller.
#RewriteRule .? %{ENV:BASE}/app.php [L]
RewriteEngine On
RewriteCond %{REQUEST_FILEname} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
# When mod_rewrite is not available, we instruct a temporary redirect of
# the startpage to the front controller explicitly so that the website
# and the generated links can still be used.
RedirectMatch 302 ^/$ /app.php/
# RedirectTemp cannot be used instead
</IfModule>
</IfModule>