symfony2 rewrite rules .htaccess app.php

Try this in your .htaccess file (inside the web directory):

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On

    # Explicitly disable rewriting for front controllers
    RewriteRule ^app_dev.php - [L]
    RewriteRule ^app.php - [L]

    RewriteCond %{REQUEST_FILENAME} !-f

    # Change below before deploying to production
    #RewriteRule ^(.*)$ /app.php [QSA,L]
    RewriteRule ^(.*)$ /app_dev.php [QSA,L]
</IfModule>

Leave a Comment