The below code will force your domain to serve securely using HTTPS. The code also forces your images, css, js files to load securely.
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
The code will work on Apache web server.