SSL redirect from HTTP to HTTPS


You can do this by adding the following code in your .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$$1 [R,L]

Don’t forget to replace with your site URL.

If you are on NGINX servers (most users are not), you would add the following to redirect from HTTP to HTTPS

server {
listen 80;
return 301$request_uri;

By following these steps, you can force http to https