diff --git a/UPGRADE-2.2.md b/UPGRADE-2.2.md index c90a4f9ea2..70d4688ee0 100644 --- a/UPGRADE-2.2.md +++ b/UPGRADE-2.2.md @@ -1,6 +1,10 @@ UPGRADE FROM 2.1 to 2.2 ======================= + * The [`web/.htaccess`](https://github.com/symfony/symfony-standard/blob/2.2/web/.htaccess) + file changed slightly to prevent duplicate content with and without `/app.php` in the URI. + So you might want to update your `.htaccess` file as well. + * The ``_internal`` route is not used any more. It should then be removed from both your routing and security configurations. A ``framgents`` key has been added to the framework configuration and must be specified when ESI or diff --git a/web/.htaccess b/web/.htaccess index 08dce6f0c0..8218abf1b1 100644 --- a/web/.htaccess +++ b/web/.htaccess @@ -5,6 +5,10 @@ # RewriteBase / # + # redirect to URI without front controller to prevent duplicate content + RewriteRule ^app\.php(/(.*)|$) /$2 [R=301,END] + + # rewrite requests to non-existent files to front controller RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^(.*)$ app.php [QSA,L] + RewriteRule ^(.*)$ app.php [END]