Landing page redirect

We’ve been facing landing page redirect if we request our site using ‘http’ protocol, site first redirect to ‘’ then to ‘’ which we want.
Check this screenshot:

While we request the site using ‘https’, it’s fine and there’s no redirect to ‘www’ and site goes to ‘’ directly.

We tried redirection with below code, it didnt work, right now we are using SGoptimizer to handle the redirect.

RewriteEngine on

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

[edited by staff]

Let us know if there’s anything you need or we need to do.