To force your website visitors to access your website using httpS:\\sitename.com instead of http:\\sitename.com , then follow the below instructions:
- Edit or create a file known as .htaccess in the root of your web folder (typically is /public_html/)
2. In the .htaccess , add the following lines:
RewriteEngine On
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]