{
my $sslport = $modSSL{'TCPPort'} || '443';
my $webmailstatus = $horde{'status'} || 'disabled';
my $sogostatus = $sogod{'status'} || 'disabled';

$OUT .= "    RewriteEngine on\n";
$OUT .= "    RewriteRule ^/sogo(/.*|\$) https://%{HTTP_HOST}/SOGo\$1 \[L,R\]\n";

if (($webmailstatus eq 'disabled') and ($sogostatus eq 'enabled')) {
     $OUT .= "    RewriteRule ^/webmail(.*|\$) https://%{HTTP_HOST}/SOGo\$1\n";
}

if ($port ne $sslport){
    ## Redirect Web Address to Secure Address
    $OUT .= "    RewriteRule ^/SOGo(/.*|\$) https://%{HTTP_HOST}/SOGo\$1 \[L,R\]\n";
}
}

