The best way is as below in .htaccess using modrewrite, any request that is not SSL will be redirected to https://domain.com and the exact same URL
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L]
ssl, urls, apache, htaccess, modrewritethe, modrewrite, redirected, https, domain, url, rewritecond, server_port, rewriterule,