<rewrite>
<enable>1</enable>
<logLevel>0</logLevel>
<rules>
RewriteCond %{https} !on
RewriteRule /(.*)$ https://%{HTTP_HOST}:7080/$1 [R=301,L]
</rules>
</rewrite>
/usr/local/lsws/admin/html/
if(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off"){
$redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$redirect = str_replace("7080", "7081", $redirect);
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . $redirect);
exit();
}