'Checks if a RewriteEngine directive is on
:param vhost: vhost to check
:type vhost: :class:`~certbot_apache.obj.VirtualHost`'

def _is_rewrite_engine_on(self, vhost):

    rewrite_engine_path_list = self.parser.find_dir('RewriteEngine', 'on', start=vhost.path)
    if rewrite_engine_path_list:
        for re_path in rewrite_engine_path_list:
            if ('virtualhost' in re_path.lower()):
                return self.parser.get_arg(re_path)
    return False
