I am unable to redirect my website from http to https
ssl is already installed on my website ()
website is working fine, all the articles and website on google opens up in https
but when I intentionally enter website or any article link with only http:// it keeps on loading and page doesnot open up
to resolve this I found the solution to force http to https through cyberpanel
I saw a code on cyberpanel community which suggests pasting any of the following code in rewrite rules:-
rewriteCond %{HTTPS} !on
rewriteCond %{HTTP:X-Forwarded-Proto} !https
rewriteRule ^(.)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
-----or-------
RewriteCond %{SERVER_PORT} ^80$
RewriteRule . https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
when I enter into rewrite rules I found a notification displayed as " It is not required to modify rules if you are using OpenLiteSpeed. Click to read more about whats changed in rewrite rules]) from v1.8 onwards." along with following rules which were already there created by cyberpanel :-
Screenshot attached (already present rewrite rules)
Here I found that the code which community suggested was already present so I just reboot my server in digital ocean, but still website was not getting redirected
I also tried changing the already present code -
rewriteCond %{HTTPS} !on
rewriteCond %{HTTP:X-Forwarded-Proto} !https
rewriteRule ^(.)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
--------to-------
RewriteCond %{SERVER_PORT} ^80$
RewriteRule . https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
followed by the rebooting of server again
but still, the problem persists
pls help me out with the problem I am facing as I don’t have deep technical knowledge.