From 7da3383c5079951fae096a55bcc558faa20af940 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Mon, 18 Feb 2013 20:09:48 +0100 Subject: [PATCH 1/3] redirect /app.php to prevent duplicate content --- web/.htaccess | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/.htaccess b/web/.htaccess index 08dce6f0c0..2b3c9fb556 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 [QSA,END] From b46c01a8265c3c79803e031725441aaf94b1f1a4 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Fri, 22 Feb 2013 13:38:52 +0100 Subject: [PATCH 2/3] removed QSA flag that is not needed --- web/.htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/.htaccess b/web/.htaccess index 2b3c9fb556..8218abf1b1 100644 --- a/web/.htaccess +++ b/web/.htaccess @@ -10,5 +10,5 @@ # rewrite requests to non-existent files to front controller RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^(.*)$ app.php [QSA,END] + RewriteRule ^(.*)$ app.php [END] From 99106de3593ba7fbdf46bf85774605ea84813656 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Fri, 22 Feb 2013 14:31:26 +0100 Subject: [PATCH 3/3] added info about changed .htaccess --- UPGRADE-2.2.md | 4 ++++ 1 file changed, 4 insertions(+) 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