Redirect HTTP to HTTPS with .htaccess

If you want to redirect all traffic from http to https, just put the following lines in your .htaccess file.

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/%{REQUEST_URI} [R,L]