28 lines
742 B
Plaintext
28 lines
742 B
Plaintext
{
|
|
my $ssl = $domain->prop('RequireSSL') || 'disabled';
|
|
my $lemon = $domain->prop('LemonLDAP') || 'disabled';
|
|
|
|
if (($modSSL{TCPPort} || "443") eq $port){
|
|
$OUT .= " SSLEngine on\n";
|
|
}
|
|
elsif (($ssl =~ m/^enabled|yes|on|1$/i) || ($lemon eq 'enabled')){
|
|
$OUT .=<<'EOF';
|
|
RewriteEngine on
|
|
RewriteRule ^/(.*|$) https://%{HTTP_HOST}/$1 [L,R]
|
|
|
|
EOF
|
|
}
|
|
elsif ($ssl =~ m#/#){
|
|
$OUT .= " RewriteEngine on\n";
|
|
foreach my $loc (split(/[;,]/, $ssl)){
|
|
$OUT .= " # Rewriting $loc to use SSL\n";
|
|
$loc =~ s#^/##;
|
|
$OUT .= " RewriteRule ^/$loc(/.*|\$) https://%\{HTTP_HOST\}/$loc\$1 \[L,R\]\n";
|
|
}
|
|
}
|
|
else{
|
|
$OUT .= '';
|
|
}
|
|
}
|
|
|