Redirect HTTP requests to HTTPS using .htaccess by adding the following code to your website’s .htaccess file.
<IfModule mod_rewrite.c>
# Redirect to HTTPS RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # End Redirect to HTTPS
</IfModule>
Comment