You can try the following:
RewriteEngine On RewriteCond %{HTTPS} !on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Just copy and paste the above code into the .htaccess file, then the whole website will be redirected to "https" when the browser opens in the "http" mode. The browser is simply redirected using url rewriting in .htaccess.
source share