In my website I want to force the use of https, so if the user go from a http url it should redirect to a https.
At the moment I have an htaccess inside /frontend/web like this:
RewriteEngine on
RewriteBase /
# Force https
RewriteCond %{HTTPS} !=on
RewriteCond %{SERVER_PORT} ^80
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
But I always get "ERR_TOO_MANY_REDIRECTS". I have no idea if I need to do a specific configuration in yii part.
How can I force the use of https without getting this errors?