To Redirect http to https using .htaccess file

Method 1.

How to redirect HTTP to https using a .htaccess file
step 1:

Login into ur cpanel and flow

step 2:

public_html —–>.htaccess ——> code editor click —–> edit

step 3: .htaccess file click

# http redirect to https - https://www.techsoftcenter.com
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Son: http redirect to https - https://www.techsoftcenter.com

Method 2.

precise routing for WordPress sites

# BEGIN HTTPS Redirection Plugin
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule>
# END HTTPS Redirection Plugin

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L] </IfModule>
# END WordPress

# Begin HTTPS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.SİTENİZ.com/$1 [R,L] </IfModule>
# END HTTPS

Method 3.

A word from the WordPress menu, the general tab in the HTTP is converted to https.