I have the following .htaccess setup:
RewriteEngine On
RewriteBase /
DirectoryIndex index.php
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
What I want to achieve:
- Redirect from http to https
- Redirect from the non-www to www
- Add trailing slash
The first two points are ok, the redirects are working as expected, but the third one doesn't.
How can I adapt the existing rules in order to add the trailing slash.