# <%= servername %>
<%- unless ssl_mode.to_s == 'only' then -%>
<%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
<%- if ssl_mode.to_s == 'force' then -%>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
<%- end -%>
<%- if not ssl_mode.to_s == 'force' then -%>
/">
AllowOverride <%= allow_override %>
<%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
<%- end -%>
<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
<%- end -%>
<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
<%- unless additional_options.to_s == 'absent' then -%>
<%= additional_options %>
<%- end -%>
<%- end -%>
<%- unless ssl_mode.to_s == 'false' then -%>
<% scope.unsetvar('vhost_part')
scope.setvar('vhost_part',:ssl) -%>
<%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
<% scope.unsetvar('vhost_part') -%>
<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
/">
AllowOverride <%= allow_override %>
<%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
Options <%= options %><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
<%- end -%>
<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
<%- unless additional_options.to_s == 'absent' then -%>
<%= additional_options %>
<%- end -%>
<%- end -%>