Turn on the Redirect and Trailing Slash modules.
Go to admin/config/search/redirect/settings
Suggested settings are shown. After saving these settings it is recommended to Clear Cache and Purge Varnish at admin/config/development/performance
- Checked: 'Automatically create redirects when URL aliases are changed.'
- Checked: 'Retain query string through redirect'
- 'Default redirect status' set to '301 moved permanently'
- Unchecked: 'Allow redirects to be saved into the page cache'
- 'Delete redirects that have not been accessed for' set to 'Never (do not discard)'
- Checked: 'Redirect alternative front page URLs to the root directory'
- Checked: 'Remove index.php from all non-front page paths'
- Checked: 'Redirect from non-clean URLs to clean URLs'
- Checked: 'Redirect from non-canonical URLs to the canonical URLs'
- Unchecked: 'Reidrect the front page to its canonical URL'
- Unchecked: 'Remove trailing slashes from paths'
- Checked 'Add trailing slashes to paths'
- Unchecked 'Allow redirections on admin paths'