I am working on a Symfony 2.8 / Sonata project, and I found that all urls a duplicated, one with "/index.php" and the other witout it. So this url :
will be redirected to :
I tried to use .htaccess to remove it, but it didn't work :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteRule ^(.*)$ app_dev.php [QSA,L]
</IfModule>
Do you have any ideas ? Thanks
Place this rule just below RewriteEngine On
to remove index.php
from URLs:
RewriteCond %{THE_REQUEST} /index\.php [NC]
RewriteRule ^index\.php(/.+)$ $1 [L,R=301,NE]