LiteSpeed Redirect Traffic To HTTPS with CyberPanel

LiteSpeed Redirect Traffic To HTTPS

To redirect traffic from http to https, you can use rules that are the same as you would use in that of apache. So, for example, the below rules will help in https redirection

RewriteCond %{HTTPS} !on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

If you are using CyberPanel, then you can edit the rules by going to your individual web panel for your domain, and clicking Rewrite Rules as shown below.

CyberPanel Rewrite Rules

After clicking it, I suggest you put the rule at the top of the file so that the redirection is processed before any other rule.CyberPanel Rewrite Rules FileAfter which, you just have to save the new rules and your good to go.CyberPanel Rewrite Rules Save

 

Enjoyed the content ? Share it with your friends !