'Redirect all equivalent HTTP traffic to ssl_vhost.
.. todo:: This enhancement should be rewritten and will
unfortunately require lots of debugging by hand.
Adds Redirect directive to the port 80 equivalent of ssl_vhost
First the function attempts to find the vhost with equivalent
ip addresses that serves on non-ssl ports
The function then adds the directive
.. note:: This function saves the configuration
:param ssl_vhost: Destination of traffic, an ssl enabled vhost
:type ssl_vhost: :class:`~certbot_apache.obj.VirtualHost`
:param unused_options: Not currently used
:type unused_options: Not Available
:raises .errors.PluginError: If no viable HTTP host can be created or
used for the redirect.'

def _enable_redirect(self, ssl_vhost, unused_options):

    if ('rewrite_module' not in self.parser.modules):
        self.enable_mod('rewrite')
    general_vh = self._get_http_vhost(ssl_vhost)
    if (general_vh is None):
        logger.debug('Did    not    find    http    version    of    ssl    virtual    host    attempting    to    create')
        redirect_addrs = self._get_proposed_addrs(ssl_vhost)
        for vhost in self.vhosts:
            if (vhost.enabled and vhost.conflicts(redirect_addrs)):
                raise errors.PluginError('Unable    to    find    corresponding    HTTP    vhost;    Unable    to    create    one    as    intended    addresses    conflict;    Current    configuration    does    not    support    automated    redirection')
        self._create_redirect_vhost(ssl_vhost)
    else:
        if (general_vh in self._enhanced_vhosts['redirect']):
            logger.debug('Already    enabled    redirect    for    this    vhost')
            return
        self._verify_no_certbot_redirect(general_vh)
        if self._is_rewrite_exists(general_vh):
            logger.warning('Added    an    HTTP->HTTPS    rewrite    in    addition    to    other    RewriteRules;    you    may    wish    to    check    for    overall    consistency.')
        if (not self._is_rewrite_engine_on(general_vh)):
            self.parser.add_dir(general_vh.path, 'RewriteEngine', 'on')
        names = ssl_vhost.get_names()
        for (idx, name) in enumerate(names):
            args = ['%{SERVER_NAME}', '={0}'.format(name), '[OR]']
            if (idx == (len(names) - 1)):
                args.pop()
            self.parser.add_dir(general_vh.path, 'RewriteCond', args)
        self._set_https_redirection_rewrite_rule(general_vh)
        self.save_notes += ('Redirecting    host    in    %s    to    ssl    vhost    in    %s\n' % (general_vh.filep, ssl_vhost.filep))
        self.save()
        self._enhanced_vhosts['redirect'].add(general_vh)
        logger.info('Redirecting    vhost    in    %s    to    ssl    vhost    in    %s', general_vh.filep, ssl_vhost.filep)
