From bb6910a068c6ead6da1b5d1ecd9f2dfe5cec2c23 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 16 May 2015 12:19:11 +1000 Subject: [PATCH] Add internal redirects (cms.enableRedirects) The application will now perform redirects to prevent duplicate content and enforce the linking policy. Fixes #665 Fixes #1023 --- CHANGELOG.md | 3 ++- config/cms.php | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da5295a1a..7a1803c92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ * **Build 25x** (2015-05-xx) - The `|page` filter now supports passing an empty string to generate a link to the current page. - Component variables set with `$this->page` no longer leech in to other component partials. + - The application will now perform redirects to prevent duplicate content and enforce the linking policy (see config `cms.enableRedirects`). * **Build 258** (2015-05-09) - The hotkey for full screen mode is now Cmd+Shift+F or Ctrl+Shift+F in Windows. @@ -71,7 +72,7 @@ * **Build 187** (2015-02-12) - **Upgraded framework to Laravel version 5**, see the [end of beta page](http://octobercms.com/beta#advanced-upgrade) for information on how to upgrade. - - Introduced a linking policy to control the way URLs are generated globally (see config cms.linkPolicy). + - Introduced a linking policy to control the way URLs are generated globally (see config `cms.linkPolicy`). - Popup control now supports several sizes via `data-size` attribute: giant, huge, large, small, tiny. - Added new scaffold command for creating form widgets `create:formwidget Acme.Blog PostSelector`. diff --git a/config/cms.php b/config/cms.php index 49d0efe81..9e5dfe2a7 100644 --- a/config/cms.php +++ b/config/cms.php @@ -239,6 +239,19 @@ return [ 'linkPolicy' => 'detect', + /* + |-------------------------------------------------------------------------- + | Determines if the application should redirect URLs. + |-------------------------------------------------------------------------- + | + | If enabled, the application middleware will redirect URLs with trailing + | and duplicat slashes. It will also redirect based on the linking policy + | defined in linkPolicy. + | + */ + + 'enableRedirects' => true, + /* |-------------------------------------------------------------------------- | Default permission mask