You need to add the code mentioned below in your .htaccess file
******************************************************************
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L] *****************************************************************