From 33c5ede6de31667d5f2a2797b1aab2d98db8a6ae Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 22 Feb 2011 23:53:29 +0100 Subject: fixing mode stuff --- templates/vhosts/default.erb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/vhosts/default.erb b/templates/vhosts/default.erb index 4a7d7f4..172518c 100644 --- a/templates/vhosts/default.erb +++ b/templates/vhosts/default.erb @@ -1,4 +1,11 @@ -<%- [:normal,:ssl].each do |vhost_part| +<%- +vhost_parts = case ssl_mode + when 'only' then [:ssl] + when false then [:normal] + when 'false' then [:normal] + else [:normal,:ssl] +end +vhost_parts.each do |vhost_part| # we need this variable in included templates @vhost_part = vhost_part %> @@ -7,7 +14,7 @@ <%= scope.function_template('apache/vhosts/partials/header_default.erb') %> <%= scope.function_template('apache/vhosts/partials/logs.erb') %> - <%- if ssl_mode == 'force' && vhost_part == :ssl %> + <%- if ssl_mode == 'force' && vhost_part == :normal %> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L] -- cgit v1.2.3