Redirect all traffic to HTTPS in Litespeed

To ensure that all traffic is served over a HTTPS connection, modify .htaccess to add the following snippet at the very top of the file:

#redirect HTTP to HTTPS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} ^80$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
</IfModule>