{
    my $ftpStatus = $ftp{'status'} || "disabled";
    my $webftpStatus = $webftp{'status'} || "disabled";

    return "    # webftp is disabled in this VirtualHost" 
	unless $webftpStatus eq 'enabled' && $ftpStatus eq 'enabled';

    my $webftpdir = '/home/httpd/html/webftp';

    if ($port ne "443")
    {
	$OUT .= <<'HERE';
    RewriteEngine on
    RewriteRule ^/webftp   https://%{HTTP_HOST}/webftp [L,R]
HERE
    }
    else
    {
        $OUT .= "    Alias       /webftp $webftpdir\n";
    }

    # prevent unencrypted "backdoor" access 
    if ($port ne '443')
    {
        $OUT .= "\n    <Location ~ \"/webftp/*\">\n";
        $OUT .= "    SSLRequireSSL\n";
        $OUT .= "    </Location>\n";
    }
}
